lukasz lukasz - 5 months ago 17
iOS Question

iOS crash logs printed to console

My problem appeared when iOS 6 was introduced, but now seems to affect 5.1.1 too.

When the app crashes, the log is printed to the 'Console' and no 'Device Logs' is saved. This is frustrating in so many ways:


  • console view is too short and all I can see is the log's tail,

  • copy/paste doesn't work, save to file... produces garbage, it is unusable,

  • there is no way to preserve logs, symbolicate it, or do anything.



It may be worth mentioning, that we work with accessories and have no way to connect debugger at the same time.

An idea how to fix this would save my day, but any decent workaround will be good too.

Thank you

EDIT: 'Console' and 'Device Logs' are the ones I get in the Organizer.

Answer

The easiest way I am aware of will require a little bit of setting up. Once setup you will have access to the full log, even since reboot time, and you can save it for later.

You need a jailbroken device. From within Cydia install the packages called syslogd to /var/log/syslog and OpenSSH. Follow the OpenSSH-tutorial on the Cydia start page (half way down). The syslogd-package has no tutorial but the install procedure is the same. After installing syslogd reboot the device.

The logs are written to /var/log/syslog. Use ssh from a terminal on your development mac to log into the device and view/tail the logs. You can scp the logs back to your development machine or can use CyberDuck or similar to get them off the device.

The logs will grow in size and I am not sure if there is something limiting, so keep an eye on file size. A friendly

> /var/log/syslog

from time to time should do.

PS: There is also a MobileTerminal package on Cydia. It will allow you to view the log directly from the device, without ssh'ing in from a second computer

Comments