tags:

views:

5320

answers:

10

I'm running Xcode, trying to get my app to run on my iphone. I'm getting the error message "the program being debugged is not being run."

+16  A: 

The solution was to remove my developer provisioning profiles from my phone using Xcode's organizer window while my phone was connected to my computer, then to re-add my developer provisioning profile, which I re-downloaded from developer.apple.com.

benvolioT
Worked for me - thanks. I think it was caused by one of my profiles expiring (even though I wasn't using that particular one at the time).
Smendrick
If you are using Xcode 3.2.3, you won't need to re-download, just remove the expired provisioning profile as mentioned above.
David
This saved me, thanks!!
bentford
+6  A: 

It only worked for me when I removed another unrelated expired provisioning profile from the device. Very weird.

leolobato
thanks, you saved my life!!!!!!!!!!!!
Digital Robot
Same for me! I had to remove all expired profiles from the device. Weird!
vfn
This worked for me as well. Thanks so much.
Oh Danny Boy
A: 

Reinstalling provisioning profiles worked for me as well. This happened after I updated my iPhone to iOS4 and updating XCode.

+1  A: 

All I needed to do to resolve this problem was reboot my device.

SomeRandomGuy
I tried deleting the development provision profile and redownloading and adding it to my iPod Touch via the Organizer window, but no luck. Shutting down Xcode and rebooting the iPod fixed it for me.
Banjer
A: 

I just had to Clean All Targets and everything worked fine again.

Tom
A: 

This happened to me after installing an AdHoc distributed app to my device. I had to restore the device to make the debugger work again.

Rafael Vega
A: 

Neither uninstalling/reinstalling the provisioning profile nor re-booting the device (nor cleaning targets, etc.) prevents these crashes for me. : {

jimiayler
A: 

The other suggestions didn't work for me either.

It started working after I changed the "application-identifier" in the Entitlements.plist to the App Id found in the Provisioning Profile. The default was $(AppIdentifierPrefix)$(CFBundleIdentifier) which I changed to "H2GC99UNHN.au.com.mydomain.myappname".

The Xcode default: $(AppIdentifierPrefix)$(CFBundleIdentifier) would work if those variables resolved correctly. CFBundleIdentifier refers to the "Bundle identifier" in your Info.plist. I never found out where to set the AppIdentifierPrefix which should be something like H2GC99UNHN.

To find your App ID in Xcode go to the Window menu, then Organizer. Click on the correct Ad Hoc provisioning profile, the App Identifier is one of the properties.

PS: To get the app on my device for testing I am using "Build and Run" in Xcode (I don't know any better). But the run part will fail because I have removed debugging symbols in my Beta configuration. Just let the run part fail and then reopen the app manually.

This error makes sense if the signed app is linked to the profile and it's certificate via the app id.

Tom
+1  A: 

To fix this I deleted the last app which I had deployed to the app using xcode and then built my current app again and it worked fine.

Ronan
A: 

For those people who are still getting this error after trying all the above, the following solution just fixed it for me after I was getting the error.

I do jailbroken development, so to bypass mandatory code signing I had modified XCode's Info.plist under /Developer/Platforms/iPhoneOS.platform.

To fix the error, just revert those modifications: replace all instances of XCCodeSignContext with XCiPhoneOSCodeSignContext in that Info.plist file.

foo
Possibly not relevant because OP isn't jailbroken.
bentford