Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view logs from iPhone?

I have place several NSLog() in my iOS application, is it possible to see all the logs later on my Mac that was generated when the app ran on iPhone handset even when iPhone was not connected with Mac. Thanks

like image 287
Firdous Avatar asked Apr 26 '12 14:04

Firdous


2 Answers

No. You can however redirect NSLog to a file, using something like this: http://blog.coriolis.ch/2009/01/09/redirect-nslog-to-a-file-on-the-iphone/

Then you can access the file via Xcode, or upload it with your app. File usage and privacy issues apply.

Keep in mind that NSLog is supposed to be turned off in published apps, so you may want to use a different logging app. A number of NSLog alternatives are available.

like image 141
Yusuf X Avatar answered Oct 15 '22 20:10

Yusuf X


Unfortunately this is not possible. The only thing that you can get is a Crash Log. If you need a better logging system, I suggest to take a look to CocoaLumberjack, a very powerful logging framework that gives you the opportunity to save log in files and, eventually, send them to a server. You also have many different levels like: log info, log error, log warning, etc...

like image 42
bontoJR Avatar answered Oct 15 '22 19:10

bontoJR