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.\"
I was having the same trouble and none of the above worked (even wiping / restoring the device).
Then I looked and saw that I had mistakenly set all my targets to use the adhoc distribution profile. Which doesn't support debugging.
See also iPhone Debugging: How to resolve 'failed to get the task for process'?
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.
I too have had this problem several times and I think I've just finally (after several months) wrapped my head around Apple's logic.
When developing, it's very common to have to use a new provisioning profile; often because you add a new tester, or an old one expires. So, you dutifully add the new user's UDID to your provisioning profile, download it and then drag that into xcode.
Then, you click on the settings for your project (or target) and tell it to use that new distribution profile. You probably used the "all configurations" under the "configurations" pull-down, like I did. Whoops.
What this does is to associate your DISTRIBUTION profile with all compile configurations. But, distribution profiles don't work with debugging! You have to make sure you don't override your DEVELOPER profile under your debug configuration. If you do that, just go back to your project, select "Debug" under configurations, and select the appropriate DEVELOPER profile to compile with.
Hope that helps, guys. -VTPete
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.
I ended up deleting my Target to fix this freakin headache. To add a new one, right-click Target > New Target > Application.
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.