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.

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....
    – user387184
    Sep 9, 2011 at 22:26

15 Answers 15

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.

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. Sep 29, 2009 at 6:02
  • 5
    I had the same issue after I accidentally set the code signing identity to a iPhone distribution in XCode 4
    – cpungaliya
    Jul 20, 2011 at 23:10
  • 1
    how do I switch the profile back to debugging if I just click "start" Aug 22, 2011 at 11:25
  • 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.
    – n13
    Apr 2, 2012 at 10:04
  • This was the answer to my problem. Had nothing to do w/ entitlements.
    – DOOManiac
    Nov 1, 2012 at 1:43
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)

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. Sep 29, 2009 at 5:59
  • 1
    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... :P
    – Alex Zak
    Jul 13, 2011 at 11:17
  • As of iOS 8.1.3 entitelments.plist is required also for enterprise signed apps.
    – Roy K
    Mar 16, 2015 at 13:21
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.

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..)
    – dsmudger
    Feb 6, 2012 at 11:20
  • Did it for me. Somehow the build was set to 'release', and the release profiles were not setup correctly.
    – KPK
    Apr 25, 2012 at 16:23
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.

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.
    – vocaro
    Sep 5, 2011 at 5:26
  • 1
    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.
    – user798719
    Aug 6, 2013 at 5:34
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.

0
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).

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!! May 13, 2014 at 22:36
  • 1
    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. Jul 10, 2014 at 15:01
  • @KendallHelmstetterGelner thx, this might be helpful to others! :D
    – Kjuly
    Jul 10, 2014 at 15:21
  • 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) Jul 10, 2014 at 15:29
  • 1
    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. Apr 28, 2015 at 15:32
12

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

1
  • This did mine - For some reason on my Target the 'Team' had changed to 'None' - changing it back sorted it. Cheers
    – Ralpharoo
    Apr 6, 2014 at 8:30
9

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

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 testflightapp
    – owen gerig
    Apr 17, 2012 at 19:09
  • I my run scheme is set to debug. Only this solution fixed it for me! Thank you.
    – Pieter
    Apr 6, 2013 at 15:45
4

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

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.

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.

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

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).

0

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

-1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.