get crash log programmatically

hi all,


i need to get crash logs programmatically when my application restarts after a crash. I know that if I enable a configuration given by apple, crashlogs are maintained in the device, which I can access using itunes / xcode. But i want to do it programmatically in my next app restart,


Thanks in advance for any help


regards

jniba

Replies

What platform are you targeting?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi Eskimo,


I target ios and android, as I have put the question in ios platform, I would first be ok with ios platform now.


thanks and regards

jniba

There’s no supported way for an iOS app to get at its own crash logs.

Lots of folks work around this by using a third-party crash reporter. In my experience that’s a poor tradeoff, because third-party crash reporters have a tendency to fail when you need them most (that is, when dealing with the nastiest in-the-field-only crashes).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi All,


Is there any update to get crash logs programmatically for iOS system, since many update released by apple.


Thanks,

Saravanan

Is there any update to get crash logs programmatically for iOS system …

No. My recommendation here is that you:

  1. Use the built-in crash reporter, rather than some third-party crash reporter

  2. Access crash reports via iTunes Connect

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi All,


Since many iOS version released after this initial thread, Is there any update to get system logs programmatically for iOS system?. Thanks in advance.


Thanks and Regards,
Saravanan

You can use PLCrashReporter. I have been using this for many years now and it does seem reliable. Here's the link if you want to explore:

https://www.plcrashreporter.org.Hope it helps.

While I’m not going to comment on specific third-party products, my general advice is that you stick with the Apple crash reporter. Building a third-party crash reporter that’s reliable, binary compatible, and sufficient to debug complex problems is essentially impossible. See Implementing Your Own Crash Reporter for more on this.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
  • I have read the "Implementing Your Own Crash Reporter" article you wrote, and do appreciate you taking the time to create such an elaborate answer. If the official "supported" method of obtaining crash information is by using Apple crash logs, then how do you propose we get them? Our applications are distributed via AirWatch, so we don't have crash logs in iTunes Connect. Also, even if we did my employer would likely not give us access to ITC in order to view the logs. We're on a very short leash. With that said how are we to obtain reliable crash logs from devices in production when a crash occurs? Currently, we're flying blind and rely on our end-users to tell us what the issue is and how to replicate, but that only goes so far. Thankfully, we don't have a lot of crashes going on, but it would be helpful to have as much details as possible when the occasional crash email comes to my inbox.

Add a Comment

how do you propose we get them?

I wrote this:

My recommendation here is that you:

  • Use the built-in crash reporter, rather than some third-party crash reporter

  • Access crash reports via iTunes Connect

three years ago and it was accurate at that time. Since then, however, we’ve introduced MetricKit, which gives you on-device programmatic access to many metrics, including crash reports.

And now I’m off to update Implementing Your Own Crash Reporter to mention that (-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"