OGeek|极客世界-中国程序员成长平台

标题: ios - ios中的CrashReporter符号化客户端 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 08:58
标题: ios - ios中的CrashReporter符号化客户端

我是使用 PLCrashReport 的新手,我想做符号化客户端。我知道有很多缺点,但我想尝试一下,请你帮帮我。

我使用了最新版本的 CrashReporter,这就是我在 appDelegate 类中引用此示例 http://plcrashreporter.googlecode.com/svn/tags/plcrashreporter-1.1-rc1/Documentation/API/example_usage_iphone.html 所做的操作.

这是一个在这里谈论这个的话题 PLCrashReporter - How to symbolicate crash data in-process?

图书馆链接: 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);



Best Answer-推荐答案


您正在链接到旧的存储库和文档。 PLCrashReporter的网址是https://www.plcrashreporter.org/文档是 https://www.plcrashreporter.org/documentation/api/v1.2/

要启用客户端符号化,您需要使用如下配置对其进行初始化:

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

这是基于下载页面上可用的最新版本 1.2:https://www.plcrashreporter.org/download

但你是对的,你不应该这样做:

您应该改为使用 dSYM 符号化崩溃报告,例如在您的 Mac 上。

关于ios - ios中的CrashReporter符号化客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25552524/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4