2014-08-28 18 views
2

我是新的使用PLCrashReport,我想作出象徵客戶端。我知道有很多缺點,但我想嘗試一下,請你幫助我。CrashReporter象徵客戶端在ios

我使用了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); 

回答

4

您正在鏈接到舊的存儲庫和文檔。 PLCrashReporter網站是https://www.plcrashreporter.org/和文檔是https://www.plcrashreporter.org/documentation/api/v1.2/

要啓用客戶端symbolication你需要這樣的配置,初始化:在下載使用

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

但你是對的,你不應該這樣做:

  • 它很慢,導致設備在發生崩潰幾秒鐘後鎖定
  • 它需要您的應用程序包含將應用程序大小增加30-50%(平均值)的符號
  • 您不會得到您的代碼的行號信息。

您應該使用dSYM來代替崩潰報告,例如,在你的Mac上。

+0

感謝您的幫助 – 2014-08-29 09:00:04

+0

因此,讓我們假設我將使用您的Quincy lib來完成符號服務器端。我會發送崩潰報告,但是: 1.我可以獲取崩潰發生的文件名嗎? 2.我可以發送附加信息與崩潰報告嗎? – 2014-08-29 09:07:21

+0

1.如果正確的dSYM可用,與dSYM的符號將爲您提供類,方法,文件名和行號。 2.據我記得有一個代表增加額外的信息。檢查頭文件。 – Kerni 2014-08-29 09:10:22