Xcode 9 error: "iPhone has denied the launch request"

IosXcodeLaunching Application

Ios Problem Overview


Using Xcode beta 9 (v4), I'm trying to launch the app by clicking on the "play" button. I get a "build succeeded" but right before launching, a popup message appears in Xcode: > "iPhone has denied the launch request."

Launch request denial error popup

It used to work yesterday. It does work on the simulator. I've rebooted my computer, the iPhone, uninstall the app, cleaned the build. Running out of ideas.

Ios Solutions


Solution 1 - Ios

It may be code sign issue. Make sure you're signing with developer, not distribution.

Solution 2 - Ios

It happens using Xcode 9.x or newer.

I tracked this problem down to the "debug executable" checkbox in the product scheme (product->scheme->edit scheme->info->debug executable checkbox). I unchecked that and this stopped happening (as well as a couple other weird issues - no output in console being one).

Solution 3 - Ios

I have a workaround:
If you change the scheme to 'Ask on Launch' it works.


In Xcode top bar

Product > Scheme > Edit Scheme > 'Info' tab > Executable:  "Ask on Launch"

http://upload-images.jianshu.io/upload_images/663014-d5d182e310052664.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240


It's slightly annoying but it works.

Solution 4 - Ios

This issue can be resolved by unchecking Debug Executable in Edit Scheme.

enter image description here

Solution 5 - Ios

After getting "denied launch request" error, do this:

Edit Scheme -> Info -> Executable -> Ask on Launch

This worked for me with adhoc profile.

Solution 6 - Ios

The problem for me was that I was using a free developer account (simply signed in with my Apple ID). When looking at the device logs I found (bold added)

> (RequestDenied); reason: "The request was denied by service delegate > (SBMainWorkspace) for reason: Security ("Unable to launch > {com.my.bundleID} because it has an invalid code signature, inadequate > entitlements or its profile has not been explicitly trusted by the > user")"

That made me realize that I needed to go into Settings -> General -> Device Management -> {My Apple ID} -> Trust

After that, everything worked as expected.

In previous versions of iOS I would encounter a dialog on my device that would tell me that this was the problem. Maybe Apple took it out for iOS 11. 樂

Solution 7 - Ios

Simple restarting of the iPhone helped me out.

Solution 8 - Ios

For me issue was due to code signing the app with Ad hoc profile.

After changing the code signing to developer profile,from xcode settings general tab the above issue got resolved.

Solution 9 - Ios

I got this issue recently and I found the solution for this crazy issue. This are the Scheme Issue to fix this issue follow following steps.

  1. Click Edit Scheme top Navigator Tab.

enter image description here

  1. Click Info on Run menu.
  2. On Executable dropdown select "Ask on Launch" option -> Then Close and run the build once.

enter image description here

This solved my problem when I got this issue.

Apple Reference

Solution 10 - Ios

Got this with Xcode 9.0 while deploying to a non-simulated iPhone 6s with iOS 10.3.

I had force-quit the app right before this arose. Otherwise, nothing had changed; all the developer signing credentials was still trusted, and the app was still marked Verified in the iPhone's Settings.

The trick that fixed it was turning the iPhone off and then turning it back on again.

Looking at my logs, it appears applicationWillTerminate was triggered a while before this happened; the instance of the app that I thought I force-quit must have been some zombie process?

Solution 11 - Ios

The problem is that xcode 'times out' after certain seconds. The fix is to edit the scheme and ask xcode to 'wait' until the executable is launched.

In Edit Scheme, check 'Wait for executable to be launched' instead of 'Automatically'

Solution 12 - Ios

I attentively read all answers but they don't help me. My solution:

  1. Go to Xcode preferences, select accounts (⌘ + ,)
  2. Select your Apple ID, choose team and click Manage Certificates
  3. In Pop up menu in bottom left corner click + button and select iOS Development, then click done and close popup
  4. Try to relaunch application, now it's should fine.

Solution 13 - Ios

It may cause with switched a wrong branch with Git, Make sure the branch you switch not too old(since it may cause code sign issue), And on the right branch if this still bothering, select the development Provisioning Profile under Signing(Debug) if u r not Automatically manage siging.

Solution 14 - Ios

Just tick "Automatically manage signing" in General -> Signing properties of the Target. It will create Development provisioning profile for you and running on the device will work.

Solution 15 - Ios

These simple steps helped me.

  1. Remove your connected iPhone, iPad from the mac.
  2. Restart your device.
  3. Select "Automatically manage signing" in Xcode settings.
  4. Reconnect your iPhone, iPad.

Solution 16 - Ios

I know there are lots of answers in this thread. I've tried every one of them but none worked for me.

TLDR:

Here is the solution:

  • Update to xcode 11.4.1 or newer

Going through all the certificates in Keychain access I found out that all of my developer certificates has a invalid status. And, I believe that, this is the root cause of this issue. I've tried the solution here saying delete Apple Worldwide Developer Relations Intermediate Certificate and everything. But, It didn't work.

Then I came across this link. Apparently, the Apple Worldwide Developer Relations Intermediate certificate (AWDRI) is set to expire in 2023 and developer certificates or any other certificates issued after January 28, 2021 won't be using that particular AWDRI certificate. Instead of that they use a renewed certificate which is set to expire in 2030. And here comes the problem, The new renewed certificate only works in xcode versions of 11.4.1 or newer. And, I have an older version of xcode.

When I updated my xcode to latest version - 12.4 (I had to go through making space on my machine, updating macos and all) The problem went away. All my developer certificates on Keychain access are now showing valid. And, I could see two AWDRI certificates on my Keychain access one expiring on 2023 and another one in 2030.

Description from the link I shared:

> The current Apple Worldwide Developer Relations Certification Intermediate Certificate (intermediate certificate) is set to expire on February 7, 2023. The renewed certificate will be used to sign new software signing certificates issued after January 28, 2021 for the Apple Developer Programs. Remaining service certificates will be updated in the future and this page will be updated to reflect additional certificate changes.

And more...

> This requirement also impacts all software signing certificates generated after January 28, 2021, by developers with Personal accounts in Xcode, as well as members of the Apple Developer Program, Apple Developer Enterprise Program, and iOS University Developer Program.

> The new Apple Worldwide Developer Relations Intermediate Certificate is downloaded automatically by Xcode 11.4.1 or later and is available for download on the Certificate Authority page. Confirm that the correct intermediate certificate is installed by verifying that the expiration date is set to 2030.

Also they are mentioning about an issue with older versions:

> Xcode 11.4.0 and earlier may not be able to sign software using signing certificates issued by the new Apple Worldwide Developer Relations Certification Intermediate Certificate. If you’re unable to upgrade to a supporting version of macOS or Xcode on your build machine, you can build and archive your app using an earlier Xcode client and sign it for distribution using the latest release. Alternatively, you can utilize the codesign tool to sign your software using the command line.

Solution 17 - Ios

I face this issue on Xcode 9.1

Scenario: I checked "Connect via Network" option for device. And trying to run app to this device with USB cable attached.

Fix: Simply remove USB cable and run.

Solution 18 - Ios

I'have tried all the answers nothing worked for me, The problem is coming form Xcode itself and has nothing to do with profiles and certificate :

> Product > Scheme > Edit Scheme

In Run (Section) / info (tab) [select] the Release instead of debug as Build Configuration as follow :

enter image description here

It's a regression since Xcode 10.1


Config : Xcode Version 10.1 (10B61) Iphone X / IOS 12.1.4

Solution 19 - Ios

I had the same issue . Its a bug in Xcode 9.1. There is a trick to make it work for now. Lock your phone. Run the code. Xcode will ask to unlock the iPhone.

Solution 20 - Ios

I just cleared the profiles with the Apple Configurator, restarted the iDevice and worked again as usual.

Solution 21 - Ios

It's an intermittent bug in Xcode - I just stopped and started all my devices and it magically worked (after messing about for 1/2 hour) I had upgraded MacOS overnight to 10.13.04 which obviously upset something! Xcode 9.3, iOS 11.3 watchOS 4.3

Solution 22 - Ios

Let me tell you a workaround which solves my problem:

  • Step 1: Windows > Devices and simulator.
  • Step 2: Unpair device.
  • Step 3: Reconnect device and trust.
  • Step 4: Run the application. BINGO.

Solution 23 - Ios

For me this issue was related to a Manually installed Enterprise Certificate and having to use it for both development and release schemes. I had to trust the certificate on the device before it would allow the app to be launched, but it would never launch as I kept getting that denied message. Eventually, editing the scheme and setting it to wait for the app to be attached before debugging did the trick.

Solution 24 - Ios

Open the App Groups in Capabilities, wait App... effective,then close the App Groups, it worked:

enter image description here

Solution 25 - Ios

After seeing all the solutions given across web, i finally found one and here are those:

  • Error occurs because of it makes Runner confused about what profile to use.
  • You will most often get this error, when you have added new account in profile in Xcode > Targets > Signing.
  • You can remove this error by just using before one Profile.
  • There is no need to create New Users.
  • or you can sign in with account you are using in Profile in your iPhone (i did this!)

Happy Days :)

Solution 26 - Ios

In case this problem occurred for you a couple of days before today, 2019-Mar-20, it is very likely related to the fact that faulty code signing certificates were issued. In that case you should be able to resolve it by just recreating the code signing certificate. This SO question already has an answer that explains you how to do so.

Solution 27 - Ios

I'm not sure whether it's a fix, or just another workaround, but uninstalling the application from my device helped. I'm still not sure what caused it, but @MrRogers answer helped me figure it out.

Solution 28 - Ios

For me the issue came-up because, I was using the Distribution Provisioning Profile to debug.

We cannot debug with Distribution Provisioning Profile, changing it to Development Provisioning Profile fixed the issue.

Steps: (Xcode 11.2.1)

  1. Select Project, Under TARGETS, select the correct target.
  2. Switch to Signing & Capabilities
  3. Under Singing section, change the Provisioning Profile to Development profile or you can just check Automatically manage signing

enter image description here

Solution 29 - Ios

None of the other answered worked -

Xcode 11+

  1. Click Edit Scheme on the top Navigator Tab.
  2. Launch option choose Wait for executable to be launched

You will have to run the application on your device manually but that will keep the debugger attached as for some of the other solutions debugger get detached.

enter image description here

Solution 30 - Ios

This error occurred for me when upgrading an Xcode 8 project to run in Xcode 9, however the iOS Base SDK in the Build Settings is still at the previous version of iPhoneOS10.3.sdk and says SDK not found. However that application still builds and runs on a device but it fails to launch. Updating the iOS Base SDK to iOS 11.0 fixes this launch problem.

Solution 31 - Ios

Today,I also meet this question.This is my way to solve. Xcode 9.0,iPhone 6s,Automatically manage signing with my account. When I select "iPhone 6s",I found that there is an logo after the iPhone 6s It's the new function of Xcode 9.0 that can run an app on the iPhone without a string connect computer(iPhone and Mac must connect the same Network). So, I try to change this kind of connect way. Open "Devices and Simulators"-> unselect "Connect via network" And then, I clean, rebuild and run my project.It works! I will be happy if this method can help you.

Solution 32 - Ios

For me it was due to xcode getting confused on what device profile to use. I used Apple Configurator 2 with below steps.

  1. Open Apple Configurator
  2. select device
  3. Actions
  4. Remove
  5. Profiles
  6. Select Old Unwanted Profiles
  7. Click "Remove Profiles"

After waiting for couple minutes unwanted profiles were removed. And rerun of application didnt have the error while launching.

Solution 33 - Ios

I faced this issue while running an old codebase. I just disabled the background fetch option from EditScheme, it worked.

Edit Scheme -> Options Tab -> Disable Background Fetch

Solution 34 - Ios

I had a similar problem and in my case, the problem was in the Build Settings of my target. The Mach-O Type was set to "Dynamic Library" instead of "Executable".

Solution 35 - Ios

I have tried every single solution there was. In the end, this was my problem: when installing the developer certificate I have set it to "Always Trust", when I changed that back to default, it worked. All credit for this goes to: https://blog.supereasyapps.com/how-to-fix-iphone-and-ipad-app-codesign-crashes-using-an-apple-developer-profile/

Solution 36 - Ios

Xcode 10 - problem resolved by removing duplicated certificate com.apple.kerberos.kdc with key. Open KeychainAccess.app -> system -> delete com.apple.kerberos.kdc with key

Solution 37 - Ios

  1. Close the app on iPhone
  2. Close your iPhone with pressing lock button right on the iPhone.
  3. Open your iPhone, run the app

Solution 38 - Ios

The many answers to the original question are a testament to Apple's messiness when it comes to code signing and provisioning.

Short answer: I could launch successfully again on device by simply deploying to another device, then going back to the device where it first failed: same AppleId, same OS (iOS 12.4.1 on both devices, macOS Mojave 10.14.3 on macBook), same project, same Xcode 10.1. No need to uncheck "debug executable" in the project scheme.

Long answer: The problem is hard to catch basically because the error is non-descriptive. Judging by the answers posted, it looks like there might be different causes, probably related to some configuration for the AppleId being used for the signing.

One way to narrow down the search is to use Apple Configurator (as hinted by @notytony here) or simply in the console under Window -> Devices and simulators -> Open Console, then choose the device (previously attached via USB cable). Like so I could catch the error message:

does not pass CT evaluation; Unrecoverable CT signature issue

which pointed me to this answer, which suggests to go over several certificates (most notably "Apple Worldwide Developer Relations Certification Authority") making sure the trust level is set to "Use System Defaults". Still I couldn't launch on device, but the previous message was no longer present in the logs. No other meaningful error was shown.

I was stuck here. Nothing listed here worked: rebooting device, revoking certificates and provisioning profiles and recreating new ones, clean build, restart Xcode, signing out and in again from AppleID,... the only workaround at this point (and only after fixing the trust issue from the certificates) was to uncheck the "debug executable" in the project scheme, which is not ideal.

I then tested on another device and it worked, even with "debug executable" enabled. After that, launching on the original device worked again as well. Something must have been reset on that AppleId account that it can successfully sign and provision apps again on the original device.

Solution 39 - Ios

I'm not 100% sure whether this is a solution, but I turned off Bluetooth and it stopped saying :

> [Name]'s iPhone denied launch request.

Solution 40 - Ios

I have the same problem in xcode10.1. I find many repeat developer accounts in keychain. Remove all developer accounts from the keychain and reconnect the phone to computer.apple will generate new developer account in keychain,then can run program. This is a case of the problem.

Solution 41 - Ios

I had this issue and I'm running on xCode 10.2.1, I'm not sure what is causing it but the first thing you should try to do is do a hard reset of the device you are trying to build to. That fixed it for me just fine. I bet these other answers have merit but any of the answers that tell you to edit the scheme WILL NOT FIX IT but just mask the issue until you need to debug. Try my fix first and see if it works and if it doesn't look at another one. This doesn't seem to be caused by just a single issue.

Solution 42 - Ios

Solution 43 - Ios

If one trying to debug the app in real iOS devices connected through XCode, make sure you have selected provisional profile with iOS development certificate.

If you have selected provisional profile with distribution certificate then you will not able to use for debugging purpose this launching app locally through XCode will not work.

Solution 44 - Ios

For me, the problem was that my development and distribution certificates were showing as not trusted in Keychain. The solution here fixed the issue:

https://developer.apple.com/forums/thread/662300

Basically, there's an updated Apple Developer Relations Intermediate Certificate that you need to download. (It could be that if I'd updated to a newer version of Xcode, it would have solved the problem, as suggested in @HasilT's answer.)

Solution 45 - Ios

It also happens when apple developer account expires for stopped payment. The old cert may be still usable to debug breakpoint for a week or few. Then one day all the sudden debug stepping on iPhone devices will be denied.

The solution is re-generate cert after paying for developer account. It may take some hours to get activated by apple.

Remember to delete old certs(ios dev, apple worldwide,) in keychain app of your mac. Revoke old cert in apple developer website optionally for cleanup. And create new one (with xcode directly is also fine) That will enable iphone debug.

Solution 46 - Ios

I had a free developer account. For me, I fixed it by paying the $99.00 developer fee to Apple.

Then went back into the Xcode PRODUCT menu and selected CLEAN BUILD FOLDER. After that this error went away.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser1988824View Question on Stackoverflow
Solution 1 - IosNikhlesh BagdiyaView Answer on Stackoverflow
Solution 2 - IosBrian MView Answer on Stackoverflow
Solution 3 - IosRio WeberView Answer on Stackoverflow
Solution 4 - IosBinshadView Answer on Stackoverflow
Solution 5 - IosNastya GorbanView Answer on Stackoverflow
Solution 6 - IosMr RogersView Answer on Stackoverflow
Solution 7 - IosAntonin CharvatView Answer on Stackoverflow
Solution 8 - IosShyamView Answer on Stackoverflow
Solution 9 - IosKameshwaran BalasubramanianView Answer on Stackoverflow
Solution 10 - IoschbrownView Answer on Stackoverflow
Solution 11 - IosA. K.View Answer on Stackoverflow
Solution 12 - IosNikita HaikoView Answer on Stackoverflow
Solution 13 - Iosd0yeView Answer on Stackoverflow
Solution 14 - IosAnton MalyshevView Answer on Stackoverflow
Solution 15 - IosiPhoneDeveloperView Answer on Stackoverflow
Solution 16 - IosHasilTView Answer on Stackoverflow
Solution 17 - IosGanpatView Answer on Stackoverflow
Solution 18 - IosA.HEDDARView Answer on Stackoverflow
Solution 19 - IosDilip KumarView Answer on Stackoverflow
Solution 20 - IosrockdaswiftView Answer on Stackoverflow
Solution 21 - Iosalan.raceQsView Answer on Stackoverflow
Solution 22 - IosRavi Kant BagoriaView Answer on Stackoverflow
Solution 23 - IosLee ProbertView Answer on Stackoverflow
Solution 24 - IosJM.TDView Answer on Stackoverflow
Solution 25 - IosBrijesh LakkadView Answer on Stackoverflow
Solution 26 - IosackhView Answer on Stackoverflow
Solution 27 - IosDragasView Answer on Stackoverflow
Solution 28 - IosSaifView Answer on Stackoverflow
Solution 29 - IosMohmmad SView Answer on Stackoverflow
Solution 30 - IoswasabinzView Answer on Stackoverflow
Solution 31 - IosPaulPaulBoBoView Answer on Stackoverflow
Solution 32 - IosnotytonyView Answer on Stackoverflow
Solution 33 - IosSuresh DurishettiView Answer on Stackoverflow
Solution 34 - IosJleuleuView Answer on Stackoverflow
Solution 35 - IossalmaneView Answer on Stackoverflow
Solution 36 - IosSerg SmykView Answer on Stackoverflow
Solution 37 - IosBatuhan ErkolView Answer on Stackoverflow
Solution 38 - IosatineoSEView Answer on Stackoverflow
Solution 39 - Iosuser11107712View Answer on Stackoverflow
Solution 40 - IosyixiaojichunqiuView Answer on Stackoverflow
Solution 41 - IosSeth KurkowskiView Answer on Stackoverflow
Solution 42 - IosSumit DixitView Answer on Stackoverflow
Solution 43 - IosMeet ShahView Answer on Stackoverflow
Solution 44 - IosmartinpolleyView Answer on Stackoverflow
Solution 45 - IosSabotenderView Answer on Stackoverflow
Solution 46 - IosJohn RobinsonView Answer on Stackoverflow