4

我试图弄清楚为什么我正在开发的应用程序在我的设备上运行时立即开始崩溃(运行 iOS 6.1 的 iPhone 4)。我已经在这个应用程序上工作了大约 8 周,这个问题似乎突然出现了。

当我在模拟器上运行该应用程序时,它运行良好。当我尝试在我的设备上运行它时,它会崩溃,并在以下位置中断:

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

崩溃发生在 AppDelegate 方法之前

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

被调用。

我查看了设备崩溃日志,但没有看到任何可以让我了解正在发生的事情的线索。有谁知道我可以从哪里开始寻找解决方案?对于它的价值,这里是崩溃日志:

异常类型:EXC_CRASH (SIGABRT) 异常代码:0x0000000000000000, 0x0000000000000000 线程崩溃:0

线程 0 名称:调度队列:com.apple.main-thread 线程 0 崩溃:0 libsystem_kernel.dylib 0x39e74350 __pthread_kill + 8 1 libsystem_c.dylib 0x39deb11e pthread_kill + 54 2 libsystem_c.dylib 0x39e2796e abort + 90 3
GraphicsServices 04RegPister GraphicsServices 0x3d57daurce 0x35e2796e 0x357da684 _GSEventInitialize + 92 5 UIKit 0x33b2d0c8 UIApplicationMain + 552 6 CK-Ranker 0x000bbaf4 main (main.m:16) 7
CK-Ranker 0x000bba7c 开始 + 36

线程 1:0 libsystem_kernel.dylib 0x39e74d98 __workq_kernreturn + 8 1 libsystem_c.dylib 0x39dc2cf6 _pthread_workq_return + 14 2 libsystem_c.dylib 0x39dc2a12 _pthread_wqthread + 362 3 libsystem_c.dylib
0x394dc28a0 start_wqthread +

线程 2 名称:调度队列:com.apple.libdispatch-manager 线程 2:0 libsystem_kernel.dylib 0x39e64648 kevent64 + 24 1
libdispatch.dylib 0x39d9d4ec _dispatch_mgr_invoke + 792 2 libdispatch.dylib 0x39d8fdf4 _dispatch_mgr_thread$VARIANT$up

线程 3:0 libsystem_kernel.dylib 0x39e74d98 __workq_kernreturn + 8 1 libsystem_c.dylib 0x39dc2cf6 _pthread_workq_return + 14 2 libsystem_c.dylib 0x39dc2a12 _pthread_wqthread + 362 3 libsystem_c.dylib
0x394dc28a0 start_wqthread +

Thread 4 name: WebThread Thread 4: 0 libsystem_kernel.dylib
0x39e63eb4 mach_msg_trap + 20 1 libsystem_kernel.dylib
0x39e64048 mach_msg + 36 2 CoreFoundation
0x31ca6040 __CFRunLoopServiceMachPort + 124 3 CoreFoundation
0x31ca4d9e __CFRunLoopRun + 878 4 CoreFoundation
0x31c17eb8 CFRunLoopRunSpecific + 352 5 CoreFoundation
0x31c17d44 CFRunLoopRunInMode + 100 6 WebCore
0x37c16500 RunWebThread(void*) + 440 7 libsystem_c.dylib
0x39dcd30e _pthread_start + 306 8 libsystem_c.dylib
0x39dcd1d4 thread_start + 4

Thread 0 crashed with ARM Thread State (32-bit): r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x3b92d534 r4: 0x00000006 r5: 0x3b92db88 r6: 0x3b933ff4 r7: 0x2fd46c48 r8: 0x1ed7a570 r9: 0x001844f0 r10: 0x00000000 r11: 0x00000000 ip :0x00000148 sp:0x2fd46c3c lr:0x39deb123 pc:0x39e74350 cpsr:0x00000010

我正在运行启用了 ARC 的 Xcode 4.6.1。

4

2 回答 2

4

您需要提供更多代码或告诉您的应用程序在启动时会做什么。

But its clear from the crash logs that the Thread0 that main UI thread has been killed. This could be because on device there is a process called watchdog, it kills any processes which seem dubious. like take too much memory or take take too much time to show first screen on app startup & other things which "Apple" thinks would affect user experience. So...

于 2013-04-12T01:21:46.113 回答
1

As it turns out there was a problem with my device. I reset my device and the crash disappeared. In future I'll be sure to remember to try resetting my device when I run into this crash.

于 2013-04-26T00:02:46.607 回答