【问题标题】:iPhone App Quits on Launch Without Crash LogiPhone 应用程序在启动时退出而没有崩溃日志
【发布时间】:2009-10-02 07:58:42
【问题描述】:

我的应用程序在通过 Xcode 启动时在 3.0 设备和 3.1 设备上运行良好,但在通过 iTunes 安装时在 3.1 设备上运行时在启动时崩溃。它不会留下任何崩溃日志,而是将其放入控制台:

Thu Oct  1 19:33:36 unknown mobile_installationd[329] <Error>: 00808e00 install_embedded_profile: Skipping the installation of the embedded profile
Thu Oct  1 19:33:37 unknown SpringBoard[24] <Warning>: Reloading and rendering all application icons.
Thu Oct  1 19:33:41 unknown com.apple.debugserver-43[342] <Warning>: debugserver-43 for armv6 Copyright (c) 2007-2009 Apple, Inc.  All Rights Reserved.
Thu Oct  1 19:33:41 unknown com.apple.debugserver-43[342] <Warning>: Connecting to com.apple.debugserver service...
Thu Oct  1 19:33:41 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.companyname.AppName[0x60c]) Spawned and waiting for the debugger to attach before continuing...
Thu Oct  1 19:33:42 unknown kernel[0] <Debug>: launchd[343] Builtin profile: container (seatbelt)
Thu Oct  1 19:33:42 unknown kernel[0] <Debug>: launchd[343] Container: /private/var/mobile/Applications/291BFBE4-F5DC-494D-B7E5-81BED01E508B (seatbelt)
Thu Oct  1 19:33:42 unknown com.apple.debugserver-43[342] <Warning>: 1 [0156/0903]: error: ::task_for_pid ( target_tport = 0x0103, pid = 343, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Thu Oct  1 19:33:42 unknown com.apple.debugserver-43[342] <Error>: error: MachTask::StartExceptionThread (): task invalid, exception thread start failed.
Thu Oct  1 19:33:42 unknown com.apple.debugserver-43[342] <Warning>: 2 [0156/0903]: error: ::task_for_pid ( target_tport = 0x0103, pid = 343, task => 0x0000 ) 0x000001f5/0x000001f5 0x000001f5/0x000001f5 err = (os/kern) failure (0x00000005)
Thu Oct  1 19:33:42 unknown com.apple.debugserver-43[342] <Warning>: 3 [0156/0903]: RNBRunLoopLaunchInferior DNBProcessLaunch() returned error: 'DRHT'
Thu Oct  1 19:33:42 unknown com.apple.debugserver-43[342] <Warning>: error: failed to launch process (null): failed to get the task for process 343
Thu Oct  1 19:33:42 unknown com.apple.debugserver-43[342] <Warning>: 4 [0156/1603]: error: ::read ( 7, 0x28091c, 1024 ) => -1 err = Bad file descriptor (0x00000009)
Thu Oct  1 19:33:42 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.companyname.AppName[0x60c]) Bug: launchd_core_logic.c:2649 (23909):10
Thu Oct  1 19:33:42 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.companyname.AppName[0x60c]) Working around 5020256. Assuming the job crashed.
Thu Oct  1 19:33:42 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.companyname.AppName[0x60c]) Job appears to have crashed: Segmentation fault
Thu Oct  1 19:33:42 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.companyname.AppName[0x60c]) Throttling respawn: Will start in 2147483647 seconds
Thu Oct  1 19:33:42 unknown SpringBoard[24] <Warning>: Application 'AppName' exited abnormally with signal 11: Segmentation fault
Thu Oct  1 19:34:42 unknown SpringBoard[24] <Notice>: MultitouchHID(208ba0) uilock state: 0 -> 1

该应用程序有一个Default.png 文件,它会显示片刻,但我认为这可能是由 SpringBoard/launchd/whatnot 加载的,所以我不认为这表明我实际上正在运行。

我在同一个盒子上创建了第二个项目,并使用相同的凭据和证书来构建它,它可以毫无问题地通过 iTunes 构建和运行。

【问题讨论】:

  • 安装后您的应用程序通常需要多长时间才能启动?在 10 CPU 秒加载时间后,您的应用程序会自动终止。
  • 在 Default.png 显示后 2 秒左右似乎退出了。不过,我会看看启动时发生了什么。

标签: iphone crash crash-log


【解决方案1】:

我将构建作为原始 .app 文件放在 Dropbox 上,尽管 codesign -vvvv AppName.app 在我这边的 Dropbox 上工作,但它显然在到达测试人员时以某种方式发生了变化。认证失败,应用程序拒绝启动。

This blog post 有助于发现这是原因,this one 有助于发现解决方案(zipping the app 使用 zip MyApp.zip -r -y MyApp.app)。

【讨论】:

    【解决方案2】:

    尝试通过注释掉您在加载时运行的代码来隔离问题,并查看您的应用是否至少在加载其主窗口。然后,逐渐取消注释代码,并使用 NSLog 语句记录初始化变量的值(使用调试器使您的问题不会发生,所以我猜 NSLog 是可以的)。如果您发现您的应用程序因花费太多时间预先加载所有内容而崩溃,请尝试通过启动一个专用的后台线程来避免主线程的繁重初始化。

    【讨论】:

      猜你喜欢
      • 2015-01-27
      • 2012-11-15
      • 2012-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多