34

I've been updating an application for more than 5 years without problems, until yesterday.

I updated my iPad to iOS 12, but, each time I try to run it, I got the message:

iPad has denied the launch request

I tested in other physical devices with iOS 11 and simulators, and this error happens only with the devices with iOS 12.

What I tried to solve this?

  • Re-generate my certificates in the Apple Developer page.
  • Editing my scheme to 'Debug Configuration' to 'Release' and checking and unchecking 'Debug executable'.
  • Restart my Mac and restart the iPad
  • Enabling and disabling 'Wait for executable to be launched'

And also, each solution of this thread: Xcode 9 error: "iPhone has denied the launch request"

And after try each one of those alternatives, the problem persist only with the devices WITH iOS 12.

Someone has an idea about how can solve this?

UPDATE I debugged my app, and this is whole the log:

predeterminado  10:33:00.516648 -0600   trustd  cert[0]: MissingIntermediate =(leaf)[force]> 0
predeterminado  10:33:00.516722 -0600   trustd  cert[0]: NonEmptySubject =(path)[]> 0
predeterminado  10:33:00.521320 -0600   SpringBoard [com.mycompany.myapp] Generating image data for snapshot: <XBApplicationSnapshot: 0x1115c11f0; identifier: 5E831360-7FEE-4255-A6FB-08712EF1D226; launchInterfaceIdentifier: __from_UILaunchStoryboardName__; contentType: GeneratedDefault> {
    creationDate = 20 de septiembre de 2018, 10:33:00 a. m. GMT-6;
    keepsImageAccessUntilExpiration = NO;
    hasGenerationContext = NO;
    context = {
        contentType = GeneratedDefault;
        fullScreen = YES;
        referenceSize = {1024, 1366};
        interfaceOrientation = LandscapeLeft;
        additionalContext = {
            statusBarSettings = <XBStatusBarSettings: 0x282f43d00; hidden: NO; style: 0x0; backgroundActivityEnabled: NO>;
        }
    }
    imageContext = {
        scale = 2.0;
        opaque = YES;
        fileRelativeLocation = none;
    }
}
predeterminado  10:33:00.585893 -0600   SpringBoard com.mycompany.myapp:10:11:3:1:Application replaced
predeterminado  10:33:00.592674 -0600   SpringBoard [com.mycompany.myapp] Application installed using default data provider
predeterminado  10:33:00.638304 -0600   dasd    com.apple.CFNetwork-cc-87-19005-Task <6A4245D9-BABF-4974-899B-B744DCB219AE>.<com.apple.cloudkit.cloudd>.<route=usmia-edge.icloud-content.com:outOfProcess=T:allowExpensive=T:powerNap=F:adaptive=T:app=com.apple.mobileslideshow:2app=com.apple.mobileslideshow.PhotosMessagesApp:disc=T:retry=F:pool=com.apple.cloudkit.BackgroundConnectionPool:uuid:C3F50637-0E71-4FCD-A8B5-DB01E2F3D518>.<1>:9D4C2B:[
    {name: ApplicationPolicy, policyWeight: 5.000, response: {Decision: Can Proceed, Score: 0.31}}
    {name: DeviceActivityPolicy, policyWeight: 10.000, response: {Decision: Can Proceed, Score: 0.60}}
 ] sumScores:58.471249, denominator:65.910000, FinalDecision: Can Proceed FinalScore: 0.887138}
predeterminado  10:33:00.662238 -0600   SpringBoard [com.mycompany.myapp] Snapshot data for <XBApplicationSnapshot: 0x1115c11f0; …08712EF1D226> written to file: /private/var/mobile/Containers/Data/Application/1DB50DD3-CF52-4498-854F-C0939D28ECC0/Library/Caches/Snapshots/com.mycompany.myapp/5E831360-7FEE-4255-A6FB-08712EF1D226@2x.ktx
predeterminado  10:33:00.666489 -0600   trustd  cert[0]: MissingIntermediate =(leaf)[force]> 0
predeterminado  10:33:00.687764 -0600   TVRemoteConnectionService   XPC: Recieved an application registered LaunchEvent
predeterminado  10:33:00.909692 -0600   trustd  cert[0]: MissingIntermediate =(leaf)[force]> 0
predeterminado  10:33:00.910738 -0600   trustd  cert[0]: SubjectCommonName =(leaf)[]> 0
predeterminado  10:33:00.910872 -0600   trustd  cert[0]: LeafMarkerOid =(leaf)[]> 0
predeterminado  10:33:00.912183 -0600   trustd  cert[0]: MissingIntermediate =(leaf)[force]> 0
predeterminado  10:33:00.912253 -0600   trustd  cert[0]: AnchorApple =(path)[]> 0
predeterminado  10:33:00.912321 -0600   trustd  cert[0]: ChainLength =(path)[]> 0
predeterminado  10:33:00.912399 -0600   trustd  cert[0]: IssuerCommonName =(path)[]> 0
predeterminado  10:33:00.943350 -0600   trustd  cert[0]: MissingIntermediate =(leaf)[force]> 0
predeterminado  10:33:00.943416 -0600   trustd  cert[0]: NonEmptySubject =(path)[]> 0
predeterminado  10:33:00.972795 -0600   trustd  cert[1]: AnchorTrusted =(leaf)[force]> 0
fightstarr20
  • 11,682
  • 40
  • 154
  • 278
JESERRANO
  • 359
  • 1
  • 3
  • 8
  • Is this a problem using Xcode to run the app on the iOS device? Are you using Xcode 10? – rmaddy Sep 20 '18 at 01:56
  • 1
    @Jerant Elias Serrano any luck, I am having same problem and all of my devices are in sama condition. 2 iPhone and 2 iPad. All of are iOS12. – modusCell Sep 20 '18 at 07:37
  • I have encountered this problem when I have way too many print statements and I have to abort ungracefully. In this situation, the problem is resolved by cold booting my phone (and removing the offending print before trying again). – Victor Engel Dec 29 '18 at 18:49

23 Answers23

30

Haozes: I fixed it by doing this:

  1. Open Edit Scheme
  2. Open Info tab
  3. Executable then select Ask on launch 

Thank god!

Edit Scheme

Reference: https://forums.developer.apple.com/thread/86729#270356

Paulo Mattos
  • 18,845
  • 10
  • 77
  • 85
Wangdu Lin
  • 913
  • 1
  • 9
  • 19
23

It took me three days to solve problem. I found two solutions. You can choose either of the two ways.

Solution 1:

Open System PreferencesUsers & GroupsAdd a user account (build with new user is successfully).

Enter image description here

Solution 2: open Keychain Access -> choose System, All Items -> delete certificate Apple Worldwide Developer Relations Certification Authority.

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Linh Vo
  • 270
  • 1
  • 5
  • 1
    This is the correct answer, and precedes the OP's own answer. It should be the accepted answer! – matt Oct 03 '18 at 16:34
  • I went with solution #2 here and it worked perfectly. Thanks! – JTing Oct 10 '18 at 09:36
  • 14
    Solution 2 worked for me, but only after I also deleted the in "login" keychain and in my project did the following: Product -> Scheme -> Edit Scheme -> Info -> Executable -> Ask on Launch – plocks Oct 17 '18 at 13:33
  • Second one worked like a charm. You saved my days. I love you. – Suhyeon Lee Jan 23 '19 at 02:52
  • 2
    Thank you @plocks! I also had to do what you described. – CodeMonkey Mar 14 '19 at 09:37
  • 3
    Another abhorrent Xcode signing bug… YES, confirm (2)! Thank you so much! What a frustrating day that would have been. I like to add: In Product -> Scheme -> Edit Scheme -> Info ➞ Executable may leave app selected but have to to deselect “Debug executable”, then works anyway. – Majakovskij Mar 14 '19 at 15:02
  • 5
    Solution 2 worked, after also following @plocks advice. I just want to say Apple and Xcode really puts me off writing iOS apps. – Gavin Mar 14 '19 at 15:35
  • Also @Binshads suggestion can be used with solution 2 – Gavin Mar 14 '19 at 15:51
  • 2
    Can't get it to work. Deleted the Certificates multiple times, recreated my developer certificate multiple times (Apple ID Personal Team, not a paid account). Did work a couple of days ago. Cleaned the project, deleted Xocde Library and Cache files. Only disabling 'Debug executable' would work but then, I can't debug which is useless. – and3rs Mar 15 '19 at 05:46
  • 1
    @and3rs I have the same situation as yours... Only the unselect `Debug executable` works. If I choose `Ask on launch`, it says `unable to launch `. Something wrong with Apple's server? --- EDIT: I just realized that even `Debug executable` doesn't work now... `Unable to launch /private/var/containers/Bundle/Application//my_app_name.app` – Tieda Wei Mar 15 '19 at 08:30
  • Started working again after I did what @Majakovskij suggested – Andrei Barbolin Mar 15 '19 at 21:28
  • 12
    disabling 'Debug executable' would work, but useless, not real solution, you cannot debug with your device !? – Nijat2018 Mar 16 '19 at 03:12
  • Where is keychain access? – Sam Mar 18 '19 at 11:09
  • After about a week of using a combination of the above solutions, I somehow managed to accidentally delete all my schemes for the project (not sure how but I think I did a revert on the project file in git) this forced my to create a new scheme which doesn't seem to have any problems running on the simulator or a physical device. – Gavin Mar 22 '19 at 10:40
  • Second solution doesn't work for me, neither does the first, what can people suggest? – Ryan H Aug 27 '19 at 14:50
16

In my case the developer account was not yet approved of on the iOS device. I had to do this manually in the Settings app:

  • Open the Settings app
  • Go to General
  • Go to Profiles & Device Management
  • Choose the profile in question and trust it
Robin Dinse
  • 1,491
  • 14
  • 20
15

I wanted to expound on the answer a little, to offer a little more detail based on what I have gone through and learned fighting this issue, and for those who, like myself, are new to Xcode and iOS development. And as in my case, I just needed to get it running as fast as possible.

My scenario was I have an Ionic 3 iOS app running on some iPads for a local non-profit as welcome desk checkin kiosk, so this app doesn't need to be public on the store. The app was crashing after a few days, and then I found out after weeks of research that it was my Apple developer account, not a bug or memory leak.

So I re-setup my Apple developer account, created new and updated signing certificates and Ad-hoc provisioning profiles with these iPads on them so they wouldn't crash any longer. I started to run the app on the devices with my shiny new certificates and profiles... and then chased this "iPad has denied the launch request" mess for a couple hours.

Here's what I learned:

Try to edit your Run Scheme first.

If the app already exists on the target device, then just set the Executable setting to "Ask on Launch", by going to ProductSchemeEdit Scheme...

Product → Scheme → Edit Scheme...

Make sure Run on the left is selected, and then open the options for Executable on the right, under the Info tab. Select "Ask on Launch", then Close.

Select "Ask on Launch"

When you try to Run the app again, a pop-up with the available apps on the target device will appear, and you will need to select your "appName.app", then click Run.

Select your "appName.app"

Don't see your "appName.app"?, then this is a fresh install, click Cancel.

Don't see your "appName.app"

If this is a fresh install, you will have to make sure Executable is set to your "appName.app". It will deny your first Run attempt, but it will have installed the app on the device. Then go back and reset Executable to "Ask on Launch" and then Run again. The "appName.app" should be in the list now.

If editing your Run Scheme doesn't get it up and running...

I'd advise next looking at your Apple developer certificates and make sure they are in line and up to date.

Take a quick peak by clicking on the info circle (i) icon next to your signing profiles.

Enter image description here

Manage your certificates here... https://developer.apple.com/account/ios/certificate

You can also have Xcode download your certificates, or just look at them listed out by going to Xcode → Preferences:

Xcode → Preferences

Then make sure you are on the Accounts tab, select your Apple ID on the left side, and then look on the bottom right for the ability to Download or Manage/View your certificates...

Enter image description here

If you had any changes/updates to your certificates, try Running your app again, and then try editing your Run Scheme again, before going to the hassle of creating a new user account.

If all else fails...

You might then try creating a new user account on your computer, and going through the process of setting that new account up with all the same certificates. But this is more than I want to detail here. I would also advise this as a last resort.

Xcode 10: iPhone has denied the launch request

Good luck!

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Shane McCurdy
  • 2,203
  • 1
  • 10
  • 11
  • This one helped me where others didn't, shame that to develop an iOS app is based on "Good Luck" :) – Lukasz 'Severiaan' Grela Mar 15 '19 at 23:31
  • 1
    So, every time I have to select a Application Name to debug ?! I do not have to do this over the past 5 years. But this issue started from the day before yesterday, so weird. I think this is not the real solution, you cannot debug with your real device if you solve the problem like this. – Nijat2018 Mar 16 '19 at 03:08
  • Life Saver!! Thanks mate!! – hashcoder Sep 23 '21 at 09:35
8

For Xcode 10.v

1 -> Delete all developer certificates in keychain.

2 -> Remove AppleID from Xcode.

3 -> Restart Xcode.

4 -> Add a AppleID again to xcode (same as previous is fine).

5 -> Restart Xcode again, (Better if ReStart your MAC).

gamal
  • 1,587
  • 2
  • 21
  • 43
6

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

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Binshad
  • 455
  • 5
  • 7
  • 9
    Not real solution, you can not debug your app with device if you solve this problem like this. – Nijat2018 Mar 16 '19 at 03:10
  • That's a really bad solution, because this will disable debugging of the app and features like Breakpoint and Crash reporting will stop working – Sarthak Mishra Mar 18 '19 at 06:38
  • I know its not real solution. I think the issue is related to certificates or provisioning profile. not sure. – Binshad Apr 02 '19 at 06:02
  • I'm testing functionality on a client's iOS app and don't need debugging at the moment; this solution got me unstuck, so thank you. – Andi Jun 05 '19 at 18:59
4

In my case, projects can't launch on iOS12+ with a specified certificate, but can for other iOS versions.

I have tried above solutions in other comments, but failed. Finally, I found the problem is from the trust setting of certificate in keychain.

My solution:

  1. Delete the old certification in keychain-> system -> all items -> your project related certificates
  2. Reinstall certificates
  3. Restart Xcode

enter image description here

Hopefully, this can save your time.

xuzepei
  • 1,119
  • 11
  • 9
  • Delete all developer certificates in keychain -> remove AppleID from Xcode -> restart Xcode. These are the exact steps that I followed to resolve my problem. Thank you. – gamal Mar 19 '19 at 08:01
  • I had to delete the same certificate in "session" ( probably "login" on the English Version of KeyChain ) Thanks for the help :) – Timothé Gauguet Mar 20 '19 at 00:42
2

Editing the ProductSchemeEdit SchemeInfo → *Executable** to change to Ask on Launch worked. However, when resetting the scheme to its original setting, the application did not launch.

Searching for a more permanent solution, I removed the developer certificate as described above (solution 2: open Keychain Access → choose System, All Items → delete certificate Apple Worldwide Developer Relations Certification Authority**), but when I relaunched Xcode my application would not launch on the device with exactly the same behavior.

The following approach appears to have resolved the issue:

  1. Removing the Apple ID from Xcode Preferences;
  2. Relaunch Xcode to add Apple ID;
  3. Add a new iOS Development Certificate in Xcode PreferencesAccountsApple IDs using the Manage Certificates button;
  4. Quit Xcode;
  5. Relaunch Xcode and the application.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
IceMan
  • 71
  • 1
  • 4
2

Here’s a solution that doesn’t involve editing the scheme and therefore makes possible to use the breakpoints as usual.

Looking in the Keychain access, searching for the keyword "developer" I found out that my iPhone certificate was flagged as "invalid" in red. So here's what I've done:

  1. I opened Keychain access and searched for the keyword "developer".
  2. I deleted the "iPhone Developer" certificate (if you have a problem with another device make sure to delete the right one).
  3. Then I deleted the "Apple Worldwide Developer Relations Certification Authority" and the "Developer ID Certification Authority" too.

After that everything worked as usual and I have been able to launch the app on my iPhone.

There’s also a video on YouTube showing this method.

Lorenzo Santini
  • 655
  • 7
  • 13
2

I solved this by checking Automatically manage Signing under Signing Capabilities on my .workspace project under Xcode 11.0.

It is a Cordova Project.

Just saying in case it help someone.

Sami Boudoukha
  • 539
  • 10
  • 25
1

Another possible solution: simply power down your device, and start it up again. Build to the device again.

Victor Engel
  • 2,037
  • 2
  • 25
  • 46
  • 1
    This was apparently downvoted because the proposed solution is mentioned in the original question. However, I note that it was not part of the question when I suggested the solution, and it worked for me when I had the same issue. It's a fine solution when it works. – Victor Engel Apr 08 '19 at 20:25
1

I ran into this issue today and none of the above solutions really worked. After paying attention to what it appears that iOS 12 and XCode are both wanting, it appears, that when running and debugging on the device from XCode, iOS wants a developer provisioning profile instead of a release distribution profile. Attempting to run on the device, from XCode, while debugging with a non developer provisioning profile causes problems of one form or another.

In that regard, if you are using manual profiles, for whatever reason you need two. One development profile and one distribution profile and use the development profile when debugging on a device.

JDL
  • 1,477
  • 21
  • 31
1

I fixed this issue by deleting the certificates in keychain and restating the Xcode again. below are the steps :

1) In keychain : System--> all items--> delete - Apple Worldwide Developer Relations Certification Authority.

2) Restart Xcode again.

this worked for me.

Rutvi
  • 11
  • 2
0

After days of research and thanks for the help @Little Green Viper, I found a solution.

Basically, some Apple Worldwide Developer Relations Certification Authority weren't working after the update, but it was able to compile successful for the iOS 11. Then, the most risky solution is deleting all the Apple Worldwide Developer Certificates, BUT before doing that, try creating a new user on your Mac.

(System PreferencesUsers and groupsNew User) that should work.

Now you have to options, work in the new user or re-sign the certificates. In my personal case, I picked up the first option.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
JESERRANO
  • 359
  • 1
  • 3
  • 8
  • 2
    Great that you got this worked out, but I would just like to point out that what you’re saying is exactly the same as Linh Vo’s earlier answer. – matt Oct 01 '18 at 18:35
0

There's a simple solution.

Change your Bundle Identifier or DisplayName or change them both. When it's working, change it back to what it used to be.

It works for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
HHD
  • 49
  • 8
0

Something that worked for me was to:

  • check the "Automatically manage signing"

That way I could make it work

That tells me tha maybe the error is somewhere in the provisioning profile.

George Vardikos
  • 2,345
  • 1
  • 14
  • 25
0

Mine was a similar incident - iOS 13 (iPadOS) / Xcode 11

provisioning profile didn't contained current device that I have tried to run the project.

  1. You can generate new provisioning profile with the device UDID
  2. Switch to auto signing
0

I try all the solutions above, but none of them works for me.

My problem is that the develop certificate in keychain is untrusted. my problem

I finally figure out a solution for myself.

  1. close the Xcode.
  2. Delete all developer certificates in the keychain.
  3. key step: go to https://www.apple.com/certificateauthority/, download and install the worldwide developer relations certificate for both versions (one expires in 2023, another in 2030) page
  4. restart the XCode, it works.
-1

The problem should be related with your certificates. Try to resign your certificates and install them on your Mac.

Also, to have a better view of your problem, connect your iPad with iOS 12 and try re-running the application. If the problem persist, you can check the logs to see more details.

On your Xcode, go to WindowDevicesSelect your deviceView Device Logs.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Benjamin RD
  • 11,516
  • 14
  • 87
  • 157
-1

I simply power down my device and started again, boom.....

sai
  • 15
  • 1
  • Looks like the person asking already tried that: "Restart my Mac and restart the iPad" – user3486184 Mar 15 '19 at 22:15
  • Hi, and welcome to Stack Overflow! It's really hard to tell if this is actually an answer. Does 'boom.....' mean that it worked or it didn't work? Or does it mean that the roof caved in? An answer of this caliber risks getting downvoted and/or deleted. – Jonathan Mar 15 '19 at 23:22
-1

I got stuck in this issue for a couple of days. I tried everything I read here but with no success. I remembered that I logged in on another two Macs with my AppleID to download some apps. I logged out of those Macs, signed in with another AppleID and downloaded something on them (I did this because I bought and downloaded a Mac App on those Macs).

It fixed my issue. Hope it helps.

SwatGuard
  • 55
  • 7
-1

I have faced the same issue.

Make sure the testing device udid is added in the developer account and if you are facing the same issue again then, Try restarting the testing device.

I solved like this.

rdj7
  • 1,905
  • 4
  • 18
  • 33
-2

I also suffered the same issues with iOS 12 and Xcode 10 yesterday. I solved it by setting "Always Embed Swift Standard Libraries" to Yes.

In Xcode, choose TargetBuild SettingsAlways Embed Swift Standard Libraries, and set the value to Yes.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
LaoTzu78
  • 1
  • 1
  • I just tried, but the same happens. The application is immediately closed – JESERRANO Sep 20 '18 at 17:56
  • 1
    Sorry that wasn't the fix for you. In looking at your log, have you researched the Missing Intermediate Certificate problem? Perhaps something Apple's docs here (https://developer.apple.com/library/archive/technotes/tn2232/_index.html#//apple_ref/doc/uid/DTS40012884-CH1-SECMISSINGINTERMEDIATES) will be of help. – LaoTzu78 Sep 20 '18 at 18:25
  • 1
    Is this one of you? https://forums.developer.apple.com/thread/109156 Looks like this may actually be an iOS 12 bug/feature ("beature"?). – Chris Marshall Sep 30 '18 at 21:48
  • BTW: The "missing intermediate certificate" issue doesn't apply here. The program croaks before it gets to didFinishLaunchingWithOptions. I've tried everything I can think of. – Chris Marshall Oct 04 '18 at 14:26