Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PLCrashReporter : Creating a human readable stacktrace

I just downloaded compiled and added PLCrashReporter to my app. I've tested it and it works fine. The sample code from the project documentation works fine.

Now, I'd like to generate a stacktrace such that I can see where exactly the app crashed. Something you would get if you look into the iphone device logs when you connect your iphone to xcode: Sample crash report from the iphone device logs

What do I have to do to get such a nice stacktrace generated with PLCrashReporter?

like image 205
toom Avatar asked Aug 26 '12 19:08

toom


2 Answers

The framework includes a text formatter in PLCrashReportTextFormatter.h:

NSString *humanReadable = [PLCrashReportTextFormatter stringValueForCrashReport:report withTextFormat:PLCrashReportTextFormatiOS];
NSLog(@"Report: %@", humanReadable);
like image 188
augusto callejas Avatar answered Dec 19 '22 13:12

augusto callejas


You need to symbolicate the crash report by using the symbolicatecrash tool which is part of Xcode. This requires the dSYM package of the exact build that created the crash report to be available. There are multiple discussion on how to do that on StackOverflow.

There are also 3rd party services which do that automatically for you, including collecting the crash reports and grouping them by similarities, and also the open source project QuincyKit with a PHP server part that helps you to collect crash reports and automate symbolication from your own Mac.

like image 42
Kerni Avatar answered Dec 19 '22 13:12

Kerni