【问题标题】:iOS - How can I decode the symbolicated crash report from iTunes Connect?iOS - 如何解码来自 iTunes Connect 的符号化崩溃报告?
【发布时间】:2013-01-27 07:36:33
【问题描述】:

我有一个新应用,但被应用商店拒绝并显示以下消息:

We found that your app crashed on an iPhone 5 and iPad 3rd Gen running iOS 6.1, which is not in compliance with the App Store Review Guidelines.

Your app crashed when we:

1) Launched the app

This occurred when your app was used:

- On Wi-Fi
- On cellular network

但我的应用程序构建目标设置是 设备:iPhone 部署目标:6.0

我的 plist 设置是: 目标设备系列:iPhone iOS 部署目标:6.0

这是我从 Apple 获得的崩溃日志:

Incident Identifier: 9CA0955F-F59D-486C-8D73-8B3B61403EE4
CrashReporter Key:   aca1b4fd3ac58a223f67f43ce5c768e6e94616f0
Hardware Model:      xxx
Process:         Fundraising [13707]
Path:            /var/mobile/Applications/E4F866A6-D1B2-48F0-B471-913FAC78B0E3/Fundraising.app/Fundraising
Identifier:      Fundraising
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2013-02-02 10:13:13.282 -0800
OS Version:      iOS 6.1 (10B141)
Report Version:  104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  0

Last Exception Backtrace:
(0x3445029e 0x3c2e997a 0x365e537c 0x3642758e 0x362b079c 0x36258c34 0x362586c8 0x36258116 0x37f4a59e 0x37f4a1ce 0x3442516e 0x34425112 0x34423f94 0x34396eb8 0x34396d44 0x362af480 0x362ac2fc 0x7a3aa 0x3c720b1c)

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x3c7e7350 __pthread_kill + 8
1   libsystem_c.dylib               0x3c75e11e pthread_kill + 54
2   libsystem_c.dylib               0x3c79a96e abort + 90
3   libc++abi.dylib                 0x3bd38d4a abort_message + 70
4   libc++abi.dylib                 0x3bd35ff4 default_terminate() + 20
5   libobjc.A.dylib                 0x3c2e9a74 _objc_terminate() + 144
6   libc++abi.dylib                 0x3bd36078 safe_handler_caller(void (*)()) + 76
7   libc++abi.dylib                 0x3bd36110 std::terminate() + 16
8   libc++abi.dylib                 0x3bd37594 __cxa_rethrow + 84
9   libobjc.A.dylib                 0x3c2e99cc objc_exception_rethrow + 8
10  CoreFoundation                  0x34396f1c CFRunLoopRunSpecific + 452
11  CoreFoundation                  0x34396d44 CFRunLoopRunInMode + 100
12  UIKit                           0x362af480 -[UIApplication _run] + 664
13  UIKit                           0x362ac2fc UIApplicationMain + 1116
14  Fundraising                     0x0007a3aa 0x79000 + 5034
15  libdyld.dylib                   0x3c720b1c start + 0

Thread 1:
0   libsystem_kernel.dylib          0x3c7e7d98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3c735cf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3c735a12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3c7358a0 start_wqthread + 4

Thread 2 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0   libsystem_kernel.dylib          0x3c7d7648 kevent64 + 24
1   libdispatch.dylib               0x3c707974 _dispatch_mgr_invoke + 792
2   libdispatch.dylib               0x3c707654 _dispatch_mgr_thread$VARIANT$mp + 32

Thread 3:
0   libsystem_kernel.dylib          0x3c7e7d98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3c735cf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3c735a12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3c7358a0 start_wqthread + 4

Thread 4:
0   libsystem_kernel.dylib          0x3c7e7d98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3c735cf6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3c735a12 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3c7358a0 start_wqthread + 4

Thread 5 name:  WebThread
Thread 5:
0   libsystem_kernel.dylib          0x3c7d6eb4 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x3c7d7048 mach_msg + 36
2   CoreFoundation                  0x34425040 __CFRunLoopServiceMachPort + 124
3   CoreFoundation                  0x34423d9e __CFRunLoopRun + 878
4   CoreFoundation                  0x34396eb8 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x34396d44 CFRunLoopRunInMode + 100
6   WebCore                         0x3a37c500 RunWebThread(void*) + 440
7   libsystem_c.dylib               0x3c74030e _pthread_start + 306
8   libsystem_c.dylib               0x3c7401d4 thread_start + 4

Thread 0 crashed with ARM Thread State (32-bit):
    r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x3e2db534
    r4: 0x00000006    r5: 0x3e2dbb88      r6: 0x208694e4      r7: 0x2fd879f4
    r8: 0x208694c0    r9: 0x00000300     r10: 0x366ce04b     r11: 0x1fd56aa0
    ip: 0x00000148    sp: 0x2fd879e8      lr: 0x3c75e123      pc: 0x3c7e7350
  cpsr: 0x00000010

我正在从这两页学习符号化: 1)http://www.raywenderlich.com/23704/demystifying-ios-application-crash-logs 2)Symbolicating iPhone App Crash Reports

我对一些事情感到困惑: 我确实有将应用程序上传到 iTunes 时制作的旧存档。但他们希望我有一个 .app 文件。那是哪个文件?那是存档吗?哪个文件是 myApp.app.dSYM 文件? 我是否只是将整个崩溃报告复制到一个文本文件中并保存在本地?

谢谢!

另外,这是应用启动时运行的一些代码:

- (void)viewDidLoad:(BOOL)animated
{
    UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"building"]];
    [self.view addSubview:imgView];
}


- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"building"]];
    imgView.frame = self.view.bounds; // to set the frame to your view's size
    [self.view addSubview:imgView];
    [self.view sendSubviewToBack:imgView];

    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
    {
        //load iphone image
        UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"building"]];

        imgView.frame = self.view.frame;

        [self.view addSubview:imgView];
        [self.view sendSubviewToBack:imgView];
    }
    else
    {
        //load ipad image
        UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"building@2x"]];
        imgView.frame = self.view.bounds; // to set the frame to your view's size
        //[self.view addSubview:imgView];

        imgView.frame = self.view.frame;
        [self.view sendSubviewToBack:imgView];
    }


    // Get user data.
    NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];

    // First arg is name and second is if not found.
    NSString *user_id = [standardUserDefaults objectForKey:@"user_id"];
    NSString *user_email = [standardUserDefaults objectForKey:@"email"];
    BOOL first_time_cookie = [standardUserDefaults boolForKey:@"first_time_cookie"];

    [super viewDidAppear:animated];

    if(!first_time_cookie)
    {
        // First time on the app, so set the user cookie.
        [standardUserDefaults setBool:YES forKey:@"first_time_cookie"];

        EmailUtil *email_new_user = [[EmailUtil alloc] initWithSubject:@"New_Download" body:@"New_iPhone_download"];
        [email_new_user send];

        // Send to server to make new acount AND send me an email re - new user.
        [self sendFeedback];

        [standardUserDefaults synchronize];
    }
    else
    {        
        EmailUtil *email = [[EmailUtil alloc] initWithSubject:@"RepeatUser" body:[NSString stringWithFormat: @"User_id: %@, and email: %@" , user_id , user_email]];
        [email send];
    }
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



-(void) sendFeedback
{
    NSString *string_url = @"http://www.my_url.php";

    NSURL *url = [NSURL URLWithString:string_url];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url ];

    NSOperationQueue *queue = [[NSOperationQueue alloc] init];

    [NSURLConnection sendAsynchronousRequest:urlRequest queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
     {
         if ( error != nil )
         {
             // Send me an email that there was an error
             EmailUtil *email = [[EmailUtil alloc] initWithSubject:@"iCreate_User_Error" body:@"There_was_some_error_creating_user_INVESTIGATE"];
             [email send];
         }
         else
             if ( data != nil )
             {
                 NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

                 NSCharacterSet* notDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];

                 if ([responseString rangeOfCharacterFromSet:notDigits].location == NSNotFound)
                 {
                     // newString consists only of the digits 0 through 9
                     NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];

                     [standardUserDefaults setObject:responseString forKey:@"user_id"];
                     [standardUserDefaults synchronize];
                 } 
             }
     }];    
}

【问题讨论】:

  • 您需要对崩溃日志进行符号化,以便查看崩溃的位置。
  • @rmaddy 你所说的象征性是什么意思? :)
  • 看起来应用程序在运行循环的第一遍中崩溃了。所以看看你在 applicationDidFinishLaunching 中所做的事情。
  • @borrrden 我实际上没有在应用程序启动时启动的控制器中的 applicationDidFinishLaunching 方法:)

标签: ios ios5 ios6 appstore-approval symbolicatecrash


【解决方案1】:

首先,您需要为要为其符号化问题的构建存储并保存 .dSYM 文件。

  1. 将 symbolicatecrash 可执行文件从该位置复制到桌面上的某个文件夹以便于访问:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources

  1. 将崩溃文件和 .dSYM 文件复制到同一个文件夹。

  2. 从终端导航到该文件夹​​并运行以下命令:

./symbolicatecrash .crash .app.dSYM

** 表示国际音标 **

如果我们使用 IPA 进行符号化 - 只需将扩展名 .ipa 重命名为 .zip ,将其解压缩,然后我们可以获得一个包含应用程序的有效负载文件夹。在这种情况下,我们不需要 .dSYM 文件。 (仅在调试符号在复制过程中未剥离的情况下)

参考:Symbolicating iPhone App Crash Reports

您是否有提交给 Apple 的 ipa 或您可以在 Organizer->Archives 下看到的存档。如果您右键单击并选择显示包内容,则会有一个名为 dSYM 的文件夹,您可以在该文件夹下找到您提交的应用程序的 dSYM 文件。

【讨论】:

  • 此答案部分错误:仅使用应用程序二进制进行符号化,仅在应用程序二进制未剥离符号时才有效(默认情况下它们会被剥离,不这样做会使二进制大小增加 30-50 %) 并通过手动符号化堆栈跟踪中的每一行并为每一行计算正确的地址。 Apple 的符号化过程始终使用 dSYM 进行符号化。
  • @kerni 感谢您指出这一点,并且只有在选择发布方案的情况下才会这样做,在这种情况下,肯定需要 dSYM 并且无论方案如何都会生成,除非选择不这样做。问题是关于象征 Apple 的崩溃,可以从用于将构建提交给 Apple 的存档中轻松找到 dSYM 文件。
【解决方案2】:

iPhone 应用程序可以在 iPad 上运行。它们在屏幕上的“窗口”中运行,大小和形状与 iPhone 屏幕相同。

话虽如此,您的应用程序在 iPhone 5 上也崩溃了。所以它并不特定于在 iPad 上运行。您需要查看崩溃日志以了解详细信息。

【讨论】:

  • 我在该版本的应用程序中并没有真正的崩溃日志。但它不会在我的模拟器上崩溃......不知道如何调试这个:(
  • 您应该已经收到带有拒绝信的崩溃日志。
  • @Genadinik 你需要在真实设备上测试,而不是模拟器。
  • @duskwuff 我刚刚在我原来的问题中添加了一些错误——它们有帮助吗?看起来很混乱!
【解决方案3】:

你错了 Targets iPhone 不是不能在 iPad 上运行的东西。但不仅适用于 iPad 适当的 UI,全屏。根据我的经验,Apple 测试了最新的操作系统 Device。所以,iPad 3 在测试。我将 iPhone 提交给 Apple。但 iPad 也经过测试。

【讨论】:

  • 那么我是否也应该为它准备一个 iPad 故事板?还是我弄错了?
  • 没有必要。只有在提交前仔细测试 iPad。我一直在测试 iPad。
  • 我刚刚在原始问题中发布了一些错误堆栈跟踪。那里有什么可能表明出了什么问题吗?谢谢!
【解决方案4】:

目标与您允许它在其上运行的目标不同...目标只是告诉 xCode 您将要在什么上测试它,它不会告诉 xCode 您希望它只能够在该设备上运行...为此,您需要在您的plist file 中查看(谷歌)设置requirementsDevice Capabilities!祝你好运! :)

【讨论】:

    【解决方案5】:

    其他人已经提到了你的构建也可以在 iPad 上运行,尽管窗口更小。因此,让我们进入分析崩溃日志的下一步。

    Exception Type:  EXC_CRASH (SIGABRT)
    

    这意味着一条消息被发送到一个没有响应的对象。 (未知的选择器崩溃)

    Thread 0:
    14  Fundraising                     0x0007a3aa 0x79000 + 5034
    

    我假设Fundraising 是您的应用程序的名称。看,这里的这一行将为您提供最后执行的方法的名称(在 0x0007a3aa 内符号化)。前提是您拥有上传到应用商店的构建版本的 .dSYM 文件。

    .dSYM 文件是您归档应用程序时生成的文件。

    所以我说你得到了那个文件,检查它出错的方法和:)。

    要了解更多信息,请访问此页面:http://www.raywenderlich.com/23704/demystifying-ios-application-crash-logs

    【讨论】:

    • 谢谢你,这很有帮助。我唯一的问题是如何将符号化代码实际输入到存档中以解码该代码?
    猜你喜欢
    • 1970-01-01
    • 2018-02-12
    • 1970-01-01
    • 2011-09-09
    • 2014-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-27
    相关资源
    最近更新 更多