How to view logs from iPhone?

21,185

Solution 1

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.

Solution 2

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...

Solution 3

You can view crash logs from your iPhone in the Organizer.

If you want to view your own log statements, you could consider TestFlight ( http://testflightapp.com ). They offer an SDK which includes features for remote logging.

Solution 4

I'm fairly certain that's not possible. The device needs to be connected to the Mac in order to run in Xcode's debug mode, and you need to be in debug mode to view the console, which contains your NSLogs.

Share:
21,185
Firdous
Author by

Firdous

Updated on December 25, 2020

Comments

  • Firdous
    Firdous over 3 years

    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

  • Justin Ohms
    Justin Ohms about 11 years
    link is dead and Google cache doesn't seem to have it
  • Yusuf X
    Yusuf X about 11 years
    Darn internet! Well here's another one that says the same thing: objcolumnist.com/2009/12/19/redirecting-nslog-to-a-log-file