This post answers the following questions:
- Why won’t my app run or debug?
- What do I do with “The application cannot be opened because the provisioning profile has expired?”
- I’m getting “The program being debugged is not being run” — help!
- What does, “Error from Debugger : The program being debugged is not being run” mean?
We were modifying an older application for a client today, and Xcode simply would not let us debug on our iPad. Xcode was telling us, “”Error from Debugger : The program being debugged is not being run.” Great. Care to tell us why?
After looking around for a bit, we tried running the app on the device by pressing the springboard icon rather than Build & Go from Xcode, and were confronted with a different error: “The application cannot be opened because the provisioning profile has expired.” Ok, that’s a little more clear, but we’re still in Apple code signing hell, which any iPhone developer knows can eat up hours of time.
Uninstalling the app and re-installing did not help, Clean All Targets didn’t help, and adjusting the code signing on both the project and the active target did nothing — both were set to use our automatically provisioned profile. We updated our automatically provisioned profile a few weeks ago to replace an expiring one, so I knew that the profile was valid. But, I checked it out anyway, and saw a screen much like this:

This screen can be found by bringing up Organizer while your device is plugged in, and then clicking on your device. What appears to have happened is that even though our new provisioning profile was downloaded by the development machine, and even though that profile was distributed to this iPad, the old profile remained and was being used by default.
Lame, but a quick solution: remove the profile with the X. For good measure, we uninstalled the app from the iPad and Cleaned All Targets, and then Build and Run ran as it should. I hope this helps (though by the time you’ve found this, you’ve probably already wasted at least half an hour trying to figure it out!).
FourTen Technologies, Inc., is a leading US iPhone app development firm. For information on having FourTen build a custom mobile application for your company, visit www.fourtentech.com. Article written by Jonathan Corbett (President & CEO, FourTen). Contact: jcorbett@fourtentech.com.