xcode 如果从应用商店或 testflight 下载 iPhone 应用程序崩溃

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16563894/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:22:56  来源:igfitidea点击:

IPhone App crashing if downloaded from app store or testflight

iosxcodetestflight

提问by RockandRoll

I am done with development process of the app, before releasing it to app store i had done several rounds of testing (Adhoc testing on IOS version 6.0.1). while doing Adhoc testing i didnt find any issues with the build. Everything was working fine. After submitting to app store i got the report from apple team saying that application is crashing on iphone 5 having IOS version 6.1.3. So i updated my iphone to 6.1.3 . After updating to latest version, i uploaded the build to testflight and downloaded the app from it. it was crashing. i uninstalled the app from phone and directly connected to system and installed directly through xcode with out any code changes. App started working fine. I am confused with reason behind crashing. I am certain it is not an issue with the code because same code is working fine if i directly install through xcode. whats the difference b/w installing app through testflight and directly from xcode ? What might be the problem ? i symbolicated the crash logs and found nothing wrong with code. does anyone has faced similar kind of problem ? if got fixed plz help me out. your help is highly admired. Thanks below is my crash log

我完成了应用程序的开发过程,在将其发布到应用程序商店之前,我已经完成了几轮测试(在 IOS 版本 6.0.1 上进行了临时测试)。在进行临时测试时,我没有发现构建有任何问题。一切正常。提交到应用程序商店后,我收到了苹果团队的报告,称应用程序在具有 IOS 版本 6.1.3 的 iphone 5 上崩溃。所以我更新了我的 iphone 到 6.1.3 。更新到最新版本后,我将构建上传到 testflight 并从中下载了应用程序。它正在崩溃。我从手机上卸载了该应用程序并直接连接到系统并通过 xcode 直接安装,无需更改任何代码。应用程序开始工作正常。我对崩溃背后的原因感到困惑。我确定这不是代码的问题,因为如果我直接通过 xcode 安装,相同的代码可以正常工作。通过 testflight 和直接从 xcode 安装应用程序的黑白有什么区别?可能是什么问题?我符号化了崩溃日志并发现代码没有任何问题。有没有人遇到过类似的问题?如果得到修复请帮助我。非常感谢您的帮助。谢谢下面是我的崩溃日志

Version:         ??? (???)
Code Type:       `enter code here`ARM (Native)
Parent Process:  launchd `enter code here`[1]
Date/Time:       2013-05-07 10:19:43.206 -0700
OS Version:      iOS 6.1.4 (10B350)
Report Version:  104
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x43462d40
Crashed Thread:  0
Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x3bc905d0 objc_msgSend + 16
1   Foundation                      0x348031dc _NSDescriptionWithLocaleFunc + 48
2   CoreFoundation                  0x33f7b42e __CFStringAppendFormatCore + 11158
3   CoreFoundation                  0x33ef289e _CFStringCreateWithFormatAndArgumentsAux +        

4   Foundation                      0x34802cf8 +[NSString stringWithFormat:] + 56
5   Nuedoo                          0x0002f8a2 -[VCache updateWithXML:] (VCache.m:122)
6   Nuedoo                          0x0003f00a -[VParser parseXMLFile:] (VParser.m:80)
7   Nuedoo                          0x0002ecda -[VBrowser open:] (VBrowser.m:23)
8   Nuedoo                          0x0002d6e8 -[Vaayoo_FrameworkAppDelegate:]   (Vaayoo_FrameworkAppDelegate.m:57)
9   UIKit                           0x35e09a9c -[UIApplication  _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 248
10  UIKit                           0x35e09620 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1164
11  UIKit                           0x35e0182e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
12  UIKit                           0x35da9d1a -[UIApplication handleEvent:withNewEvent:]   + 1006
13  UIKit                           0x35da97a8 -[UIApplication sendEvent:] + 68
14  UIKit                           0x35da91ea _UIApplicationHandleEvent + 6194
15  GraphicsServices                0x37ac15f4 _PurpleEventCallback + 588
16  GraphicsServices                0x37ac1222 PurpleEventCallback + 30
17  CoreFoundation                  0x33f6f3e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
18  CoreFoundation                  0x33f6f386 __CFRunLoopDoSource1 + 134
19  CoreFoundation                  0x33f6e20a __CFRunLoopRun + 1378
20  CoreFoundation                  0x33ee1238 CFRunLoopRunSpecific + 352
21  CoreFoundation                  0x33ee10c4 CFRunLoopRunInMode + 100
22  UIKit                           0x35e00468 -[UIApplication _run] + 664
23  UIKit                           0x35dfd2b4 UIApplicationMain + 1116
24  Nuedoo                          0x00056efa main (main.m:14)
25  Nuedoo                          0x0002ce84 start + 36
Thread 1:
0   libsystem_kernel.dylib          0x3c189d98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3c0d7ad6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3c0d77f2 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3c0d7680 start_wqthread + 4

Thread 2 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0   libsystem_kernel.dylib          0x3c1795d0 kevent64 + 24
1   libdispatch.dylib               0x3c0b4d22 _dispatch_mgr_invoke + 806
2   libdispatch.dylib               0x3c0b0374 _dispatch_mgr_thread + 32

Thread 3:
0   libsystem_kernel.dylib          0x3c189d98 __workq_kernreturn + 8
1   libsystem_c.dylib               0x3c0d7ad6 _pthread_workq_return + 14
2   libsystem_c.dylib               0x3c0d77f2 _pthread_wqthread + 362
3   libsystem_c.dylib               0x3c0d7680 start_wqthread + 4

Thread 4 name:  WebThread
Thread 4:
0   libsystem_kernel.dylib          0x3c178e30 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x3c178fd0 mach_msg + 48
2   CoreFoundation                  0x33f6f2b6 __CFRunLoopServiceMachPort + 126
3   CoreFoundation                  0x33f6e02c __CFRunLoopRun + 900
4   CoreFoundation                  0x33ee1238 CFRunLoopRunSpecific + 352
5   CoreFoundation                  0x33ee10c4 CFRunLoopRunInMode + 100
6   WebCore                         0x39ee9390 RunWebThread(void*) + 440
7   libsystem_c.dylib               0x3c0e20de _pthread_start + 306
8   libsystem_c.dylib               0x3c0e1fa4 thread_start + 4

Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x1f5c0ab0    r1: 0x39a512ae      r2: 0x34004b3a      r3: 0xffffffff
r4: 0x43462d38    r5: 0x00000000      r6: 0x34004b3a      r7: 0x2fdd3178
r8: 0x2fdd367c    r9: 0x0e6944ab     r10: 0x3c307c20     r11: 0x1f5c0ca0
ip: 0x3c3b8704    sp: 0x2fdd3164      lr: 0x348031e1      pc: 0x3bc905d0
  cpsr: 0x20000030
</string>
<key>displayName</key>
<string>Nuedoo</string>
<key>name</key>
<string>Nuedoo</string>
<key>os_version</key>
<string>iPhone OS 6.1.4 (10B350)</string>
<key>system_ID</key>
<string></string>
<key>version</key>
<string>??? (???)</string>
</dict>
</plist> 

回答by alex-i

Installing the app directly through XCode will use your 'Debug' configuration (depends also on how it's set in your build scheme). Archiving it first, will use your Adhoc/Release configuration.

直接通过 XCode 安装应用程序将使用您的“调试”配置(也取决于它在您的构建方案中的设置方式)。首先存档,将使用您的 Adhoc/Release 配置。

Edit schemesEdit scheme

编辑方案编辑方案

The configurations may differ in search paths, constants, preprocessor macros and other things used during compile/build time.

这些配置可能在搜索路径、常量、预处理器宏和编译/构建期间使用的其他内容方面有所不同。

Since it's working well when built directly from xcode, you may have a look at the differences between your Run build configuration ('Debug') and your 'Archive' build configuration ('Adhoc' in the image above).

由于它在直接从 xcode 构建时运行良好,因此您可以查看运行构建配置(“调试”)和“存档”构建配置(上图中的“Adhoc”)之间的差异。

To view differences between your configurations, select your app target and search for the fields with <Multiple values>(inside Build Settings tab) enter image description here

要查看您的配置之间的差异,请选择您的应用程序目标并使用<Multiple values>(在“构建设置”选项卡内) 搜索字段在此处输入图片说明

You may also be able to set your 'Run' step to use the 'Release' configuration (with a correct provisioning that accepts your device), in which case you should be able to catch the exception when connected to xcode (and maybe have a better look at what's causing it using breakpoints).

您还可以将“运行”步骤设置为使用“发布”配置(具有接受您的设备的正确配置),在这种情况下,您应该能够在连接到 xcode 时捕获异常(并且可能有一个使用断点更好地查看导致它的原因)。

回答by GayleDDS

KERN_INVALID_ADDRESS is ether a bad cast or a zombie object. If it was a bad cast it should crash in debug as well as release. The debugger can hide some memory errors. The good news it the crash in repeatable in the release build. You just need to profile your app in Instruments using the Zombie Instrument.

KERN_INVALID_ADDRESS 是一个坏演员或僵尸对象。如果它是一个错误的演员,它应该在调试和发布中崩溃。调试器可以隐藏一些内存错误。好消息是在发布版本中可重复崩溃。您只需要使用 Zombie Instrument 在 Instruments 中分析您的应用程序。

Here is a good tutorial: http://www.dimzzy.com/blog/2011/02/hunting-down-zombies-in-ios-apps/

这是一个很好的教程:http: //www.dimzzy.com/blog/2011/02/hunting-down-zombies-in-ios-apps/