7

I can read the console when the device is plugged into my machine via Xcode.

I need to build in a way to read the console for my test users to get console output messages and crash reports from the device and then email them via the email dialog.

Is there a standard file location where the console log and crash reports live on iOS?

Streamline
  • 2,040
  • 4
  • 37
  • 56
  • This will answer your questions as well: http://stackoverflow.com/a/8511100/474794 – Kerni Jan 12 '12 at 19:11
  • If you are still interested in reading the console, see the answer here: http://stackoverflow.com/a/19148654/211292 – ThomasW Jan 29 '15 at 08:54

1 Answers1

4

The console is not saved to a file on the iPhone (which is why reboots completely clear it).

I would recommend replacing your NSLogs with something that logs to the console as well as a file within the Documents directory of your app and allow provide functionality within the app to send in the file to an email.

The location of where the crash logs are kept is outside the sandbox of the application, so you can't access the crash logs directly, but sync'ing with iTunes will cause them to be uploaded to the developer's iTunes Connect account.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Ben S
  • 68,394
  • 30
  • 171
  • 212
  • Interesting - this is actually a titanium app and was hoping to just read the contents of the logs just after a crash to get a better idea of what happened - we have a test user experiencing a crash that we can't reproduce with our device. – Streamline Jan 12 '12 at 01:26
  • Also, there are a few apps (like one called console http://itunes.apple.com/us/app/console/id317676250) that reads the console for you on the device so it must be readable even if its not a file. Right? – Streamline Jan 12 '12 at 01:30
  • AFAIK, it's not an actual file, but a UNIX pipe, so you can read from it as messages appear, but they aren't saved to disk. – Ben S Jan 12 '12 at 01:40
  • Using the ASL API you can get the content of the console, but I would not recommend to do so, NSLog is slow and should be avoided in any distribution for general logging (beta or release). Also iTunes Connect is not a reliable source for crash reports, read here why: http://taptaptap.com/blog/cameraplus-2-3-1-available-attack-of-the-crashinator/ and http://www.hockeyapp.net/blog/2011/5/28/dont-be-afraid-of-crashes.html – Kerni Jan 12 '12 at 19:18