iPhone Debugging: How to resolve 'failed to get the task for process'?
Asked Answered
A

15

158

I have just added a provisioning profile to XCode (needed to support notifications and in app purchase), setup as needed the build configuration for ad hoc distribution, and tried to run the app on the device (I have done this several times in the past, without any problem).

The app is installed, but it does not start. On the console, I see the following message:

Error launching remote program: failed to get the task for process 82.
Error launching remote program: failed to get the task for process 82.
The program being debugged is not being run.
The program being debugged is not being run.

However, if I start the application on the device manually, it works as expected. I have recently installed the latest XCode 3.2 for Snow Leopard. Is this a known bug of this version of XCode or am I doing something wrong?

EDIT: It works fine with release distribution using the development provisioning profile. I have checked again the ad hoc provisioning profile to make sure it includes the device I am using.

Agra answered 28/9, 2009 at 18:29 Comment(1)
also this may help: go to Organizer -> Projects -> DerivedData delete and clean. Make sure all the signings in Project and Target are set consistently and correctly - this helped in my case....Australia
O
110

I have had problems debugging binaries on the device via XCode when the app includes an Entitlements.plist file, which is not necessary to install onto the device for debugging. In general, then, I have included this file for release builds (where it is required for the App Store) and removed it for debugging (so I can debug the app from XCode). That may be your problem here.

Update: As of (at least) August 2010 (iPhone 4.1 SDK) the Entitlements.plist is no longer necessary to include in your application in many cases (e.g., distribution through the App Store.) See here for more information on the cases when Entitlements.plist is required:

IMPORTANT: An Entitlements file is generally only needed when building for Ad Hoc Distribution or enabling Keychain data sharing. If neither of these is true, delete the entry in Code Signing Entitlements. (emphasis mine)

On answered 28/9, 2009 at 20:12 Comment(3)
You are right, I have verified that it is indeed the get-task-allow boolean value set to false in Entitlements.plist that prevents debugging. Thank you.Agra
FYI, I had the exact same problem and the thing that solved the problem was ADDING the entitlement file with the get-task-allow set to YES... so if you have the same problem and you don't have the entitlements file, try adding it... :PEtherize
As of iOS 8.1.3 entitelments.plist is required also for enterprise signed apps.Hospitalize
U
290

The ad-hoc profile doesn't support debugging. You need to debug with a Development profile, and use the Ad-Hoc profile only for distributing non-debuggable copies.

Unpredictable answered 28/9, 2009 at 21:28 Comment(9)
To the best of my knowledge, I have not seen this information on the developr program portal. But my comment to fbrereto explains why this is so: we do not have the Entitlements.plist file neither in debug nor in release configurations.Agra
I had the same issue after I accidentally set the code signing identity to a iPhone distribution in XCode 4Eliathas
how do I switch the profile back to debugging if I just click "start"Blat
Just another one of those little pitfalls Apple put up for you. Just had this happen after re-doing all my profiles and certs thanks to a portal bug... sigh. Thanks for the info, fixed my issue.Haberdasher
This was the answer to my problem. Had nothing to do w/ entitlements.Bushire
As spankmaster79 asked: @cdespinosa, how does one set the build to "Debug"?Calliecalligraphy
That could have been given a bit more helpful error message... but thanks!Bookcase
as @Eliathas says, setting the code sign to a distribution profile ends up in this error.Haleyhalf
Go to build settings. Under Code Signing --> Provisioning Profile make sure under debug has a development profile and not your ad hoc profile. If Provisioning Profile is not expanded, then it may be applying the same profile to both debug and release.Costar
O
110

I have had problems debugging binaries on the device via XCode when the app includes an Entitlements.plist file, which is not necessary to install onto the device for debugging. In general, then, I have included this file for release builds (where it is required for the App Store) and removed it for debugging (so I can debug the app from XCode). That may be your problem here.

Update: As of (at least) August 2010 (iPhone 4.1 SDK) the Entitlements.plist is no longer necessary to include in your application in many cases (e.g., distribution through the App Store.) See here for more information on the cases when Entitlements.plist is required:

IMPORTANT: An Entitlements file is generally only needed when building for Ad Hoc Distribution or enabling Keychain data sharing. If neither of these is true, delete the entry in Code Signing Entitlements. (emphasis mine)

On answered 28/9, 2009 at 20:12 Comment(3)
You are right, I have verified that it is indeed the get-task-allow boolean value set to false in Entitlements.plist that prevents debugging. Thank you.Agra
FYI, I had the exact same problem and the thing that solved the problem was ADDING the entitlement file with the get-task-allow set to YES... so if you have the same problem and you don't have the entitlements file, try adding it... :PEtherize
As of iOS 8.1.3 entitelments.plist is required also for enterprise signed apps.Hospitalize
T
37

I Had the same issue, but resolved it by following simple following steps :

  1. Make sure you have selected debug rather than release.
  2. In Debug configurations, in project settings, you should have selected developer's profile & no need of specifying the entitlements plist.
  3. Also same setting are there under: Targets: , if not manuall change them to the above for the debug config. It will work.

All the best.

Thunderstorm answered 8/11, 2010 at 18:24 Comment(2)
The reason this worked is almost certainly that your Debug config has get-task-allow set in Entitlements.plist whereas the Release one doesn't - this is to stop people attaching the debugger to they copy they get from the App Store (see-also Kai's answer below about setting it to yes to get it to work..)Burnet
Did it for me. Somehow the build was set to 'release', and the release profiles were not setup correctly.Wulf
S
19

This took me a while to figure out.

If you are using a distribution / ad hoc/ profile you cannot test it through xcode. You will get the error: The program being debugged is not being run.

You can build the app, go to the products folder in your app in xcode, click on the file with your project name and choose reveal in finder. You can drag this app into into iTunes and sync and that point you can test your app on your device.

Serilda answered 12/5, 2010 at 22:24 Comment(2)
Yeah, this was my problem. I had no Entitlements file, but I had switched my debug build configuration to a distribution profile. Switching to a development profile fixed everything.Zora
I wish XCode would be more upfront about this. It's not obvious at all that you can't test a distribution build on a device while being connected to XCode. It's a common use case.Earthwork
D
13

If you are getting such error, the only reason could be you using a Distribution profile rather than a development profile in Xcode or a missing Entitlement property. If you are not using the Entitlements.plist, then the only possible error could be the app is getting packaged with a distribution profile. You could verify this confirming the build logs. To change this, go to Build Setting of the project and verify Code Signing Entity setting. For debugging to work, this setting should be a developer profile for the configuration that you are currently using.

https://developer.apple.com/library/ios/#qa/qa1682/_index.html

For instant results, delete all mobile provisioning profiles from xcode and install the developer profile that you intend to use.

Duchamp answered 7/3, 2012 at 8:32 Comment(0)
M
13

Almost 2hrs on this issue! And finally I solved it by replacing the

iPhone Developer

to

iPhone Developer: My Dev Account Name

for Debug's CODE_SIGN_IDENTITY:

  1. Select Project Target
  2. Build Settings
  3. Search by "code sign"
  4. Modify CODE_SIGN_IDENTITY section's Debug row with "iPhone Developer: My Dev Account Name", not just "iPhone Developer".

I've no idea why it works, but it does! At least for me!


Environment: Xcode 5.0 (5A1412).

Mellon answered 5/11, 2013 at 3:59 Comment(5)
this worked for me too, thanks. had to fiddle with exactly what identities to use, but it eventually liked a certain combo. Xcode 6 really needs an "auto correct" feature for this sort of stuff, lots of housekeeping I don't have time for!!Deltoid
Just to add to this what I did was similar, but different - I changed the profile to be the team profile (which is used for debugging), which set the code signer to be "automatic" - in XCode 5+ you really should be selecting the profile for a build and letting it decide what signer to use based on that.Condolent
@KendallHelmstetterGelner thx, this might be helpful to others! :DMellon
Also should add I changed the team profile for the "Debug" build, which is used to run on device from in XCode (unless you alter the scheme settings)Condolent
This solved my issue with this problem without doing anything other than rebuilding with a different code signing identity. Thank you! In my case, I was using an ad-hoc distribution identity.Pergrim
C
12

Check ur code signing section.make sure that the code signing is iPhoneDeveloper code signe

Compendium answered 6/2, 2013 at 6:59 Comment(1)
This did mine - For some reason on my Target the 'Team' had changed to 'None' - changing it back sorted it. CheersFreestone
B
9

Open Entitlements.plist and set the boolean value get-task-allow to YES - the debugger can attach now!

Brittani answered 15/6, 2010 at 16:35 Comment(2)
ya i have tried this many times and dont understand why it doesnt fix the problem. this would be the best method if you still wanted to incorporate testflightappWain
I my run scheme is set to debug. Only this solution fixed it for me! Thank you.Disputable
E
4

Go to Edit Schemes and under Run -> Info -> Build Configuration, change from Ad-Hoc to Debug. Click OK to save.

Euroclydon answered 25/9, 2012 at 20:6 Comment(0)
B
1

It might be that you have an expired development profile on your phone.

My development provisioning profile expired several days ago and I had to renew it. I installed the new profile on my phone and came up with the same error message when I tried to run my app. When I looked at the profile settings on my phone I noticed the expired profile and removed it. That cleared the error for me.

Biochemistry answered 25/3, 2010 at 17:22 Comment(0)
H
1

As stated by Buffernet, you cannot use a distribution provisioning profile to debug. When I switched to a developer provisioning profile, I got the error "A Valid Provisioning Profile For This Executable Was Not Found".

A quick google for this lead me to the article listed below. From there, I realised that I hadn't got a valid development provisioning profile as my iPhone hadn't been added to the Provisioning Portal and all the other stuff involved.

Make sure you run an iPhone developer provisioning profile and your device has been added to the provisioning portal!

http://iosdevelopertips.com/xcode/a-valid-provisioning-profile-for-this-executable-was-not-found.html

Heriot answered 2/3, 2011 at 16:28 Comment(0)
S
1

I received this error when I tried to launch app from Xcode as I figured I had selected distribution profile only. Build was successful so I created .ipa file. I used testflightapp.com to run the app. You can use iTunes as well.

Selfimprovement answered 27/5, 2013 at 6:2 Comment(0)
B
0

Yes , Provisioning profiles which are for distribution purpose, i.e. Distrutions provisioning profiles do not support debugging and gives this error. Simply create and use debug provisioning profile (take care of this when creating provisioning profile from developer.apple.com account).

Brandebrandea answered 21/11, 2012 at 12:11 Comment(0)
D
0

I just changed my bundleIdentifier name, that seemed to do the trick.

Diaeresis answered 7/4, 2014 at 12:3 Comment(0)
M
-1

I've patched my project with JailCoder http://jailcoder.com/ and problem resolved. Just download It and drag your xcode project to It.

Morgenthaler answered 1/11, 2012 at 19:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.