title: Running App on iPhone4 from Xcode fails
body: <p>I have a problem when running my App on my iPhone from Xcode.  The App runs (seemingly) fine in the simulators (iPhone, iPad, etc).  It also runs fine when loaded on the iPhone4 or iPad2, it is only when trying to start the App from Xcode (version 4.5) that I get the following message from Xcode: Could not launch "" failed to get task for process 1024", and the only message in the Xcode output windows is:</p>
  
  <pre><code>error: failed to launch '/private/var/mobile/Applications/36159066-FEDB-4A26-A05D-E599F397074A/MetriScan.app' -- failed to get the task for process 1024`
  </code></pre>
  
  <p>There is no crash log on the iPhone, but the console log contains the following (cleared before the run):</p>
  
  <pre><code>Oct 29 11:14:37 Bjarne mobile_house_arrest[1015] &lt;Error&gt;: Max open files: 125
  ��Oct 29 11:14:38 Bjarne installd[31] &lt;Error&gt;: 0x2fe93000 handle_install: Install of "/var/mobile/Media/PublicStaging/MetriScan.app" requested by mobile_installation_proxy
  ��Oct 29 11:14:38 Bjarne installd[31] &lt;Error&gt;: 0x2fe93000 MobileInstallationInstall_Server: Installing app Bjarne.Christensen.MetriScan
  ��Oct 29 11:14:39 Bjarne installd[31] &lt;Error&gt;: Oct 29 11:14:39  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
  ��Oct 29 11:14:40 Bjarne SpringBoard[509] &lt;Warning&gt;: Killing Bjarne.Christensen.MetriScan for termination assertion
  ��Oct 29 11:14:40 Bjarne com.apple.launchd[1] (UIKitApplication:Bjarne.Christensen.MetriScan[0x89b7][792]) &lt;Notice&gt;: (UIKitApplication:Bjarne.Christensen.MetriScan[0x89b7]) Exited: Killed: 9
  ��Oct 29 11:14:40 Bjarne backboardd[52] &lt;Warning&gt;: Application 'UIKitApplication:Bjarne.Christensen.MetriScan[0x89b7]' exited abnormally with signal 9: Killed: 9
  ��Oct 29 11:14:40 Bjarne kernel[0] &lt;Debug&gt;: launchd[1018] Builtin profile: syncdefaultsd (sandbox)
  ��Oct 29 11:14:40 Bjarne installd[31] &lt;Error&gt;: 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] &lt;Error&gt;: 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: &lt;CFBasicHash 0x1cdaa9d0 [0x3ac39100]&gt;{type = mutable set, count = 18,
      entries =&gt;
          0 : &lt;CFString 0x3ac259f4 [0x3ac39100]&gt;{contents = "CFBundlePackageType"}
          1 : &lt;CFString 0x1cdab130 [0x3ac39100]&gt;{contents = "BuildMachineOSBuild"}
          2 : &lt;CFString 0x3ac26a44 [0x3ac39100]&gt;{contents = "CFBundleResourceSpecification"}
          3 : &lt;CFString 0x1cda7440 [0x3ac39100]&gt;{contents = "DTPlatformBuild"}
          4 : &lt;CFString 0x3ac23794 [0x3ac39100]&gt;{contents = "DTCompiler"}
          5 : &lt;CFString 0x3ac25564 [0x3ac39100]&gt;{contents = "CFBundleSignature"}
          6 : &lt;CFString 0x3ac26224 [0x3ac39100]&gt;{contents = "DTSDKName"}
          7 : &lt;CFString 0x1cd7e720 [0x3ac39100]&gt;{contents = "NSBundleResolvedPath"}
          8 : &lt;CFString 0x3ac22eb4 [0x3ac39100]&gt;{contents = "UISupportedInterfaceOrientations"}
          10 : &lt;CFString 0x3ac2ae84 [0x3ac39100]&gt;{contents = "DTXcode"}
          13 : &lt;CFString 0x3ac2aeb4 [0x3ac39100]&gt;{contents = "CFBundleInfoDictionaryVersion"}
          16 : &lt;CFString 0x3ac28304 [0x3ac39100]&gt;{contents = "CFBundleSupportedPlatforms"}
          17 : &lt;CFString 0x1cd89710 [0x3ac39100]&gt;{contents = "DTXcodeBuild"}
          18 : &lt;CFString 0x1cdacc30 [0x3ac39100]&gt;{contents = "UIStatusBarTintParameters"}
          19 : &lt;CFString 0x3ac26e54 [0x3ac39100]&gt;{contents = "DTPlatformVersion"}
          20 : &lt;CFString 0x3ac29bf4 [0x3ac39100]&gt;{contents = "DTPlatformName"}
          21 : &lt;CFString 0x3ac2ac84 [0x3ac39100]&gt;{contents = "CFBundleDevelopmentRegion"}
          22 : &lt;CFString 0x1cda5800 [0x3ac39100]&gt;{contents = "DTSDKBuild"}
      }
  ��Oct 29 11:14:42 Bjarne installd[31] &lt;Error&gt;: 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: &lt;CFBasicHash 0x1cdaa9d0 [0x3ac39100]&gt;{type = mutable set, count = 18,
      entries =&gt;
          0 : &lt;CFString 0x3ac259f4 [0x3ac39100]&gt;{contents = "CFBundlePackageType"}
          1 : &lt;CFString 0x1cd89710 [0x3ac39100]&gt;{contents = "BuildMachineOSBuild"}
          2 : &lt;CFString 0x3ac26a44 [0x3ac39100]&gt;{contents = "CFBundleResourceSpecification"}
          3 : &lt;CFString 0x1cdab130 [0x3ac39100]&gt;{contents = "DTPlatformBuild"}
          4 : &lt;CFString 0x3ac23794 [0x3ac39100]&gt;{contents = "DTCompiler"}
          5 : &lt;CFString 0x3ac25564 [0x3ac39100]&gt;{contents = "CFBundleSignature"}
          6 : &lt;CFString 0x3ac26224 [0x3ac39100]&gt;{contents = "DTSDKName"}
          7 : &lt;CFString 0x1cd9b540 [0x3ac39100]&gt;{contents = "NSBundleResolvedPath"}
          8 : &lt;CFString 0x3ac22eb4 [0x3ac39100]&gt;{contents = "UISupportedInterfaceOrientations"}
          10 : &lt;CFString 0x3ac2ae84 [0x3ac39100]&gt;{contents = "DTXcode"}
          13 : &lt;CFString 0x3ac2aeb4 [0x3ac39100]&gt;{contents = "CFBundleInfoDictionaryVersion"}
          16 : &lt;CFString 0x3ac28304 [0x3ac39100]&gt;{contents = "CFBundleSupportedPlatforms"}
          17 : &lt;CFString 0x1cd78400 [0x3ac39100]&gt;{contents = "DTXcodeBuild"}
          18 : &lt;CFString 0x1cd68ba0 [0x3ac39100]&gt;{contents = "UIStatusBarTintParameters"}
          19 : &lt;CFString 0x3ac26e54 [0x3ac39100]&gt;{contents = "DTPlatformVersion"}
          20 : &lt;CFString 0x3ac29bf4 [0x3ac39100]&gt;{contents = "DTPlatformName"}
          21 : &lt;CFString 0x3ac2ac84 [0x3ac39100]&gt;{contents = "CFBundleDevelopmentRegion"}
          22 : &lt;CFString 0x1cd9cee0 [0x3ac39100]&gt;{contents = "DTSDKBuild"}
      }
  ��Oct 29 11:14:42 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: debugserver-189 for armv7.
  ��Oct 29 11:14:42 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: Connecting to com.apple.debugserver service...
  ��Oct 29 11:14:42 Bjarne kernel[0] &lt;Debug&gt;: lockbot[1013] Builtin profile: debugserver (sandbox)
  ��Oct 29 11:14:42 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 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]) &lt;Warning&gt;: (UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa]) Spawned and waiting for the debugger to attach before continuing...
  ��Oct 29 11:14:46 Bjarne amfid[1025] &lt;Error&gt;: Oct 29 11:14:46  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
  ��Oct 29 11:14:47 Bjarne kernel[0] &lt;Debug&gt;: launchd[1024] Builtin profile: container (sandbox)
  ��Oct 29 11:14:47 Bjarne kernel[0] &lt;Debug&gt;: launchd[1024] Container: /private/var/mobile/Applications/36159066-FEDB-4A26-A05D-E599F397074A (sandbox)
  ��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 1 +0.000000 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 2 +0.105567 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 3 +0.101283 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 4 +0.102423 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 5 +0.100074 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 6 +0.102276 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:47 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 7 +0.104515 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 8 +0.118398 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 9 +0.117044 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 10 +0.100288 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] &lt;Error&gt;: error: MachTask::StartExceptionThread (): task invalid, exception thread start failed.
  ��Oct 29 11:14:48 Bjarne librariand[96] &lt;Error&gt;: 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] &lt;Warning&gt;: 11 +0.477484 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:48 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 12 +0.150354 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 13 +0.291521 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 14 +0.114934 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 15 +0.168568 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 16 +0.123600 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 17 +0.115101 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 18 +0.101293 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:49 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 19 +0.101731 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:50 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 20 +0.108046 sec [03fe/0303]: error: ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 1024, &amp;task ) =&gt; err = 0x00000005 ((os/kern) failure) (0x00000005)
  ��Oct 29 11:14:50 Bjarne com.apple.debugserver-189[1022] &lt;Warning&gt;: 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] &lt;Warning&gt;: 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] &lt;Warning&gt;: 22 +0.002978 sec [03fe/1303]: error: ::read ( 5, 0x2fe80a0c, 1024 ) =&gt; -1 err = Bad file descriptor (0x00000009)
  Oct 29 11:14:50 Bjarne com.apple.launchd[1] (UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa][1024]) &lt;Notice&gt;: (UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa]) Exited: Killed: 9
  ��Oct 29 11:14:50 Bjarne backboardd[52] &lt;Warning&gt;: Application 'UIKitApplication:Bjarne.Christensen.MetriScan[0x7faa]' exited abnormally with signal 9: Killed: 9
  ��
  </code></pre>
  
  <p>Unfortunately, I don't get much out of the log :)  But I am curious about the first line about Max open files, is that a problem.</p>
  
  <p>I have a feeling that the problem somehow is with the Info.plist but I don't know where to start.</p>
  
  <p>I should mention that it used to work fine up until about a month ago, my last working backup, and I can't see any difference in the code between that and the next non-working backup.  I mostly run the code in the simulator or loaded directly in my test devices through iTunes, that is why it took me so long to discover the problem.  I have been working on localization since that time and maybe that is where the problem crept in?</p>
  
  <p>I googled the problem, but did not come up with anything that seemed to apply, and I have re-booted the iPhone and the iMac, and of course deleted the App from the iPhone in between.</p>
  
  <p>Any help and pointers would be greatly appreciated.</p>