PLCrashReporter : Creating a human readable stacktrace
Asked Answered
G

2

9

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?

Garibay answered 26/8, 2012 at 19:52 Comment(0)
O
3

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.

Ossify answered 11/11, 2012 at 14:35 Comment(0)
D
17

The framework includes a text formatter in PLCrashReportTextFormatter.h:

NSString *humanReadable = [PLCrashReportTextFormatter stringValueForCrashReport:report withTextFormat:PLCrashReportTextFormatiOS];
NSLog(@"Report: %@", humanReadable);
Devour answered 4/9, 2012 at 8:37 Comment(8)
Thanks for the answer. This prints a stacktrace. But the recieved stacktrace just contains memory addresses. This is not what I'm looking for.Garibay
Did you get answer for this yet?Octant
Above code works perfectly with new version PLCrashReporter.It's print with method name and line number.Prophase
hi, i tried the PLCrashReportTextFormatter using latest PLCrashReporter, it only gives me "Application Specific Info"...threads info..."binary images".. no function name or line numbers are to be seen. Why?Complain
This is generally the case because the application was build without symbols. This is the default case for release builds. Look into "symbolicating iOS crash logs". That should point you in the right direction. (Kerni talks about it a bit in his answer)Aegospotami
how to get class name and method name ? i am not able to do that.. please help meHanford
I can't find the PLCrashReportTextFormatter.h in my framwork. I have integrated the PLCrashReporter via Pods. can you provide the linkScrawny
I have changed the build settings not to strip debug symbols. However the crash text formatter still doesn't show the method names. Any ideas?Virginity
O
3

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.

Ossify answered 11/11, 2012 at 14:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.