error: failed to launch app -- iPhone has denied the launch request.

I was working on my app in Xcode and, after making some changes in Interface Builder and installing to my iPhone, this error popped up:

error: failed to launch '/private/var/containers/Bundle/Application/long number/MyApp.app' -- X’s iPhone6 has denied the launch request. (Where X is me).


I've tried:

Quitting and relaunching Xcode

Powering down and restarting the iPhone

Installing the latest Xcode beta 9.1 Beta 9B46

Toggling the checkmark for "Automatically manage signing"

Using Simulator (which works)


I've found reference to this error elsewhere and some people had success by paying attention to their signing. I'm signing as an iOS Developer, so I don't know what else to do.

Replies

Same issue here.


The only workaround I have found is locking the device, running the debugger, letting it wait for about 1 minute, then unlocking the device to let the debugger attach.


That said, this is completely awful and adds a ton of wasted time to the development flow. Can anyone from Apple weigh on in what's going on?


I've tried everything OP has tried, as well as clearing out all profiles on the device but one.

I've noticed that the app installs and runs OK on the iPhone, it's just that Xcode fails to attach during launch. When I tried to attach manually, my app was greyed out because it thinks it's already attached. I'll have to try your technique to force a re-attachment.

I'm unable to re-attach in a way that gives me output to the console. Can you please give more detail on how you re-attach? Do you get console output afterwards?

Same here. It's maddening; causing hours of lost productivity. My app successfully launches from Xcode 9 about 2% of the time; otherwise it times out with "iPhone has denied the launch request" or similar. Often the app will launch immediately after I click "OK" in the timeout dialog, but if that happens it's not attached (and won't attach) to the debugger. The app is signed with a perfectly valid Dev certificate. This bug is currently affecting all of my apps, not just one.

I have the same issue, make me crazy, after i update from xcode9.0 to xcode9.1. Hope this problem be fixed by Apple Dev

Any luck? I've been stuck for over a week unable to do any development! I can launch my app if I uncheck "debug executable", but then I can't debug anything I'm doing!


I've spent many days scouring the internet, messing around with provisioning profiles, certificates, and clicking various (random?!) build settings hoping to figure this out. By now I'm worried if this ever gets fixed that I've screwed something else up with all my mucking about.


This is absolutely infuriating.

My teammates and I are also running into this issue. Using "Automatically manage signing" has fixed it for one person, but not the others. Help!

Please file a radar, including a sysdiagnose, and report the radar number here. There's not enough information to go in in this post, but the logs in the sysdiagnose should point to the problem.


Please indicate the time of the failure as well.

Radar filed: https://bugreport.apple.com/web/?problemID=35654312


Please let me know if there's any further information I can provide to help you track this down. Thanks!

Thanks for the radar. The launch request is being denied by the device, so we would need a sysdiagnose from your iPhone. Would you be able to do that, as outlined here:

https://developer.apple.com/bug-reporting/profiles-and-logs/?name=sysdiagnose

Submitted the sysdiagnose. Thanks.

What was the conclusion of this investigation ?


We are interested to know, in case…

Bump. Any update on this?


I'm in certificate/trust wilderness on this one. It feels like wack-a-mole. The behavior of Xcode changes, but not the final result. The app won't launch on the target phone, but runs happily on the simulator.


Thanks for any update/solutions.

i have been confused by this problem several week. my app also works well in simulator and stucks in target device.

Have you solved it ?

Did you find a solution yet?