ios - 从 Xcode 在 iPhone4 上运行应用程序失败

标签 ios xcode debugging

我在 iPhone 上从 Xcode 运行我的应用程序时遇到问题。该应用程序在模拟器(iPhone、iPad 等)中(看似)运行良好。它在 iPhone4 或 iPad2 上加载时也运行良好,仅当尝试从 Xcode(版本 4.5)启动应用程序时,我从 Xcode 收到以下消息:无法启动“”未能获得进程 1024 的任务”, Xcode 输出窗口中的唯一消息是:

error: failed to launch '/private/var/mobile/Applications/36159066-FEDB-4A26-A05D-E599F397074A/MetriScan.app' -- failed to get the task for process 1024`

iPhone 上没有崩溃日志,但控制台日志包含以下内容(运行前清除):

Oct 29 11:14:37 Bjarne mobile_house_arrest[1015] <Error>: Max open files: 125
��Oct 29 11:14:38 Bjarne installd[31] <Error>: 0x2fe93000 handle_install: Install of "/var/mobile/Media/PublicStaging/MetriScan.app" requested by mobile_installation_proxy
��Oct 29 11:14:38 Bjarne installd[31] <Error>: 0x2fe93000 MobileInstallationInstall_Server: Installing app Bjarne.Christensen.MetriScan
��Oct 29 11:14:39 Bjarne installd[31] <Error>: Oct 29 11:14:39  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
��Oct 29 11:14:40 Bjarne SpringBoard[509] <Warning>: Killing Bjarne.Christensen.MetriScan for termination assertion
��Oct 29 11:14:40 Bjarne com.apple.launchd[1] (UIKitApplication:Bjarne.Christensen.MetriScan[0x89b7][792]) <Notice>: (UIKitApplication:Bjarne.Christensen.MetriScan[0x89b7]) Exited: Killed: 9
��Oct 29 11:14:40 Bjarne backboardd[52] <Warning>: Application 'UIKitApplication:Bjarne.Christensen.MetriScan[0x89b7]' exited abnormally with signal 9: Killed: 9
��Oct 29 11:14:40 Bjarne kernel[0] <Debug>: launchd[1018] Builtin profile: syncdefaultsd (sandbox)
��Oct 29 11:14:40 Bjarne installd[31] <Error>: 0x2fe93000 MobileInstallationInstall_Server: Staging: 0.43s; Waiting: 0.00s; Installation: 1.42s; LS Sync: 0.16s; Overall: 2.16s
��Oct 29 11:14:41 Bjarne installd[31] <Error>: 0x2fe93000 filter_attributes: Info.plist keys requested via MobileInstallationLookup/Browse in client Xcode (via mobile_installation_proxy) were not found in MobileInstallation's cache. Please file a bug requesting that these keys be added: <CFBasicHash 0x1cdaa9d0 [0x3ac39100]>{type = mutable set, count = 18,
    entries =>
        0 : <CFString 0x3ac259f4 [0x3ac39100]>{contents = "CFBundlePackageType"}
        1 : <CFString 0x1cdab130 [0x3ac39100]>{contents = "BuildMachineOSBuild"}
        2 : <CFString 0x3ac26a44 [0x3ac39100]>{contents = "CFBundleResourceSpecification"}
        3 : <CFString 0x1cda7440 [0x3ac39100]>{contents = "DTPlatformBuild"}
        4 : <CFString 0x3ac23794 [0x3ac39100]>{contents = "DTCompiler"}
        5 : <CFString 0x3ac25564 [0x3ac39100]>{contents = "CFBundleSignature"}
        6 : <CFString 0x3ac26224 [0x3ac39100]>{contents = "DTSDKName"}
        7 : <CFString 0x1cd7e720 [0x3ac39100]>{contents = "NSBundleResolvedPath"}
        8 : <CFString 0x3ac22eb4 [0x3ac39100]>{contents = "UISupportedInterfaceOrientations"}
        10 : <CFString 0x3ac2ae84 [0x3ac39100]>{contents = "DTXcode"}
        13 : <CFString 0x3ac2aeb4 [0x3ac39100]>{contents = "CFBundleInfoDictionaryVersion"}
        16 : <CFString 0x3ac28304 [0x3ac39100]>{contents = "CFBundleSupportedPlatforms"}
        17 : <CFString 0x1cd89710 [0x3ac39100]>{contents = "DTXcodeBuild"}
        18 : <CFString 0x1cdacc30 [0x3ac39100]>{contents = "UIStatusBarTintParameters"}
        19 : <CFString 0x3ac26e54 [0x3ac39100]>{contents = "DTPlatformVersion"}
        20 : <CFString 0x3ac29bf4 [0x3ac39100]>{contents = "DTPlatformName"}
        21 : <CFString 0x3ac2ac84 [0x3ac39100]>{contents = "CFBundleDevelopmentRegion"}
        22 : <CFString 0x1cda5800 [0x3ac39100]>{contents = "DTSDKBuild"}
    }
��Oct 29 11:14:42 Bjarne installd[31] <Error>: 0x2ffb5000 filter_attributes: Info.plist keys requested via MobileInstallationLookup/Browse in client Xcode (via mobile_installation_proxy) were not found in MobileInstallation's cache. Please file a bug requesting that these keys be added: <CFBasicHash 0x1cdaa9d0 [0x3ac39100]>{type = mutable set, count = 18,
    entries =>
        0 : <CFString 0x3ac259f4 [0x3ac39100]>{contents = "CFBundlePackageType"}
        1 : <CFString 0x1cd89710 [0x3ac39100]>{contents = "BuildMachineOSBuild"}
        2 : <CFString 0x3ac26a44 [0x3ac39100]>{contents = "CFBundleResourceSpecification"}
        3 : <CFString 0x1cdab130 [0x3ac39100]>{contents = "DTPlatformBuild"}
        4 : <CFString 0x3ac23794 [0x3ac39100]>{contents = "DTCompiler"}
        5 : <CFString 0x3ac25564 [0x3ac39100]>{contents = "CFBundleSignature"}
        6 : <CFString 0x3ac26224 [0x3ac39100]>{contents = "DTSDKName"}
        7 : <CFString 0x1cd9b540 [0x3ac39100]>{contents = "NSBundleResolvedPath"}
        8 : <CFString 0x3ac22eb4 [0x3ac39100]>{contents = "UISupportedInterfaceOrientations"}
        10 : <CFString 0x3ac2ae84 [0x3ac39100]>{contents = "DTXcode"}
        13 : <CFString 0x3ac2aeb4 [0x3ac39100]>{contents = "CFBundleInfoDictionaryVersion"}
        16 : <CFString 0x3ac28304 [0x3ac39100]>{contents = "CFBundleSupportedPlatforms"}
        17 : <CFString 0x1cd78400 [0x3ac39100]>{contents = "DTXcodeBuild"}
        18 : <CFString 0x1cd68ba0 [0x3ac39100]>{contents = "UIStatusBarTintParameters"}
        19 : <CFString 0x3ac26e54 [0x3ac39100]>{contents = "DTPlatformVersion"}
        20 : <CFString 0x3ac29bf4 [0x3ac39100]>{contents = "DTPlatformName"}
        21 : <CFString 0x3ac2ac84 [0x3ac39100]>{contents = "CFBundleDevelopmentRegion"}
        22 : <CFString 0x1cd9cee0 [0x3ac39100]>{contents = "DTSDKBuild"}
    }
��Oct 29 11:14:42 Bjarne com.apple.debugserver-189[1022] <Warning>: debugserver-189 for armv7.
��Oct 29 11:14:42 Bjarne com.apple.debugserver-189[1022] <Warning>: Connecting to com.apple.debugserver service...
��Oct 29 11:14:42 Bjarne kernel[0] <Debug>: lockbot[1013] Builtin profile: debugserver (sandbox)
��Oct 29 11:14:42 Bjarne com.apple.debugserver-189[1022] <Warning>: Got a connection, waiting for process information for launching or attaching.
��Oct 29 11:14:46 Bjarne com.apple.launchd[1] (UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa][1024]) <Warning>: (UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa]) Spawned and waiting for the debugger to attach before continuing...
��Oct 29 11:14:46 Bjarne amfid[1025] <Error>: Oct 29 11:14:46  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
��Oct 29 11:14:47 Bjarne kernel[0] <Debug>: launchd[1024] Builtin profile: container (sandbox)
��Oct 29 11:14:47 Bjarne kernel[0] <Debug>: launchd[1024] Container: /private/var/mobile/Applications/36159066-FEDB-4A26-A05D-E599F397074A (sandbox)
��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] <Warning>: 1 +0.000000 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] <Warning>: 2 +0.105567 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] <Warning>: 3 +0.101283 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] <Warning>: 4 +0.102423 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] <Warning>: 5 +0.100074 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] <Warning>: 6 +0.102276 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] <Warning>: 7 +0.104515 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] <Warning>: 8 +0.118398 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] <Warning>: 9 +0.117044 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] <Warning>: 10 +0.100288 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] <Error>: error: MachTask::StartExceptionThread (): task invalid, exception thread start failed.
��Oct 29 11:14:48 Bjarne librariand[96] <Error>: client process 1024 does not have a valid com.apple.developer.ubiquity-container-identifiers entitlement
��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] <Warning>: 11 +0.477484 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] <Warning>: 12 +0.150354 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] <Warning>: 13 +0.291521 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] <Warning>: 14 +0.114934 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] <Warning>: 15 +0.168568 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] <Warning>: 16 +0.123600 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] <Warning>: 17 +0.115101 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] <Warning>: 18 +0.101293 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] <Warning>: 19 +0.101731 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:50 Bjarne com.apple.debugserver-189[1022] <Warning>: 20 +0.108046 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005)
��Oct 29 11:14:50 Bjarne com.apple.debugserver-189[1022] <Warning>: 21 +0.013752 sec [03fe/0303]: RNBRunLoopLaunchInferior DNBProcessLaunch() returned error: 'failed to get the task for process 1024'
��Oct 29 11:14:50 Bjarne com.apple.debugserver-189[1022] <Warning>: error: failed to launch process (null): failed to get the task for process 1024
Oct 29 11:14:50 Bjarne com.apple.debugserver-189[1022] <Warning>: 22 +0.002978 sec [03fe/1303]: error: ::read ( 5, 0x2fe80a0c, 1024 ) => -1 err = Bad file descriptor (0x00000009)
Oct 29 11:14:50 Bjarne com.apple.launchd[1] (UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa][1024]) <Notice>: (UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa]) Exited: Killed: 9
��Oct 29 11:14:50 Bjarne backboardd[52] <Warning>: Application 'UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa]' exited abnormally with signal 9: Killed: 9
��

不幸的是,我没有从日志中得到太多 :) 但我很好奇关于 Max open files 的第一行,这是一个问题吗。

我感觉问题出在 Info.plist 上,但我不知道从哪里开始。

我应该提一下,它在大约一个月前一直运行良好,这是我的最后一个工作备份,我看不出那个和下一个非工作备份之间的代码有任何区别。我主要在模拟器中运行代码或通过 iTunes 直接加载到我的测试设备中,这就是我花了这么长时间才发现问题的原因。从那时起我就一直致力于本地化工作,也许这就是问题所在?

我用谷歌搜索了这个问题,但没有找到任何似乎适用的东西,我重新启动了 iPhone 和 iMac,当然还删除了介于两者之间的 iPhone 上的应用程序。

如有任何帮助和指点,我们将不胜感激。

最佳答案

事实证明这是一个代码签名问题。不久前,我在将 iPad 3 添加到我的临时分发测试设备时遇到了问题,我更改了登录代码以尝试使其正常工作。那是一个 iOS 分发证书,我现在必须将其改回开发人员证书才能从 Xcode 运行 iPhone。从这里可以清楚地看出,我确实没有完全理解整个代码签名和分发过程。

但它再次起作用,太棒了。

关于ios - 从 Xcode 在 iPhone4 上运行应用程序失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13127796/

相关文章:

ios - 谁能告诉我如何在 Objective C 中为具有 NSDictionary 的 NSArray 设置 NSPredicate?

ios - 设置 Root View Controller 不起作用?

ios - 在 UITableview Cell 中播放视频

iphone - plist 不会以编程方式删除

java - 我正在尝试创建一个 Android 应用程序,它使用符号链接(symbolic link)在另一个应用程序中复制文件并在中央 Android 日志中打印

c++ - 数据文件放在哪里以便 Microsoft Visual C++ 2008 调试器可以找到它们?

ios - 如何将每种食物添加到 Realm 中自己的食物类别?

ios - Xcode Interface Builder 为所有文件显示 "No selection"

xcode - 如何在 Xcode 中获取 "Delete derived data"?

debugging - 是否有任何 Debug模式?