views:

8393

answers:

7

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.

+17  A: 

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)

fbrereto
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.
unforgiven
+8  A: 

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.

cdespinosa
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.
unforgiven
A: 

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.

hkatz
A: 

Restarting the computer solved the problem for me.

Forzina
A: 

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.

Buffernet
+1  A: 

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

Kai
A: 

2 Kai Thanx a lot!

Siap