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

前端 未结 14 975
轻奢々
轻奢々 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:02

    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'?

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

    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.

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

    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

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

    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.

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

    I ended up deleting my Target to fix this freakin headache. To add a new one, right-click Target > New Target > Application.

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

    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.

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