Search code examples
iosobjective-cplcrashreporter

CrashReporter symbolication client side in ios


i'm new of using PLCrashReport and i whant to make symbolication client side. I khnow that there is many disadvantages but i want to try it, can you help me please.

I used the last version of CrashReporter and this what i done in the appDelegate class refering to this example http://plcrashreporter.googlecode.com/svn/tags/plcrashreporter-1.1-rc1/Documentation/API/example_usage_iphone.html.

The is a topic that talk about this here PLCrashReporter - How to symbolicate crash data in-process?

Link to the library: https://www.plcrashreporter.org/.

(void) applicationDidFinishLaunching: (UIApplication *) application {
    PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
    NSError *error;

    if ([crashReporter hasPendingCrashReport])
        [self handleCrashReport];

    if (![crashReporter enableCrashReporterAndReturnError: &error])
        NSLog(@"Warning: Could not enable crash reporter: %@", error);

Solution

  • You are linking to an old repository and documentation. The website of PLCrashReporter is https://www.plcrashreporter.org/ and the documentation is https://www.plcrashreporter.org/documentation/api/v1.2/

    To enable client side symbolication you need to initialize it with a configuration like this:

      PLCrashReporterSignalHandlerType signalHandlerType = PLCrashReporterSignalHandlerTypeBSD;
      PLCrashReporterSymbolicationStrategy symbolicationStrategy = PLCrashReporterSymbolicationStrategyNone;
      PLCrashReporterConfig *config = [[PLCrashReporterConfig alloc] initWithSignalHandlerType: signalHandlerType
                                                                               symbolicationStrategy: symbolicationStrategy];
      PLCrashReporter *crashReporter  = [[PLCrashReporter alloc] initWithConfiguration: config];
    

    This is based on the latest version 1.2 available on the download page: https://www.plcrashreporter.org/download

    But you are right, you should not do this:

    • It is slow, caused the device to lock up when the crash happens for a few seconds
    • It requires your app to include symbols which increased the app size by 30-50% (on average)
    • You won't get line number information for your code.

    You should instead symbolicate the crash reports using the dSYM, e.g. on your Mac.