XCode fails to run app on device, saying the program being debugged is not being run

Viewed 23959

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

14 Answers

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

You should check which certificate you ase using, remember to use developer provision for debug on you device and ensure all configuration is done.

I have two developer identities (work and home) and use the same device for development. I also use a wildcard app identifier (xxxxxxxxxx.*) at home, and I often build different apps using the same profile. Sometimes when I switch locations (e.g. from work to home) I get the above error.

Removing and re-adding the developer profiles from the device, reloading the profile from Apple and restarting the device (in various combinations) did not solve the issue for me.

What did enable running and debugging on the device again was:

  • go to project settings in Xcode (double-click project name)
  • search for "identity" to find the setting "Code Signing Identity" / "Any iOS"
  • tick "iPhone Developer: My Name (mydevid)" under the section for my home profile (for Application Identifiers '*')
  • do not tick "iPhone Developer:" under "Automatic Profile Selector", even if it "currently matches" the same developer ID and profile

(I also quit Xcode and did rm -rf build, but that is probably not needed).

I just had to power off my iPhone device and restart the same.

I tried in this order:

  1. Delete app in Xcode.
  2. Delete build folder in Finder.
  3. Restart device.

Only 3. worked for me.

imp: My Provisoning profiles are valid for almost a year and there was no reason for them to expire (I even cross-checked them to be doubly sure :)). If this hadn't work, I would have checked - as someone rightly suggested, if Developer provisioning profile was being used - which was, in my case.

Related