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

前端 未结 14 977
轻奢々
轻奢々 2020-12-14 16:35

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条回答
  • 2020-12-14 17:13

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

    0 讨论(0)
  • 2020-12-14 17:16

    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.

    0 讨论(0)
  • 2020-12-14 17:16

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

    0 讨论(0)
  • 2020-12-14 17:18

    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.

    0 讨论(0)
  • 2020-12-14 17:20

    Ah, latest version: I have Core-Plot framework included in my project. My old development profile expired and I dowloaded new profile, changed the project with the latest profile, but I had this error anyway.

    So, I needed to open Core-Plot framework project itself, change code signing there to latest profile, build it, go back to my original project, rebuild it and then everything started working fine again.

    0 讨论(0)
  • 2020-12-14 17:21

    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.

    0 讨论(0)
提交回复
热议问题