iOS 12 iPad 拒绝启动请求 - Xcode

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/52415694/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:33:23  来源:igfitidea点击:

iOS 12 iPad Denied Launch Request - Xcode

xcodeipadios12

提问by JESERRANO

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

我一直在更新应用程序超过 5 年没有问题,直到昨天。

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

我将 iPad 更新到 iOS 12,但是,每次尝试运行它时,都会收到以下消息:

iPad has denied the launch request

iPad 拒绝了启动请求

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

我在其他装有 iOS 11 和模拟器的物理设备上进行了测试,这个错误只发生在装有 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'
  • 在 Apple Developer 页面中重新生成我的证书。
  • 将我的“调试配置”方案编辑为“发布”并选中和取消选中“调试可执行文件”。
  • 重新启动我的 Mac 并重新启动 iPad
  • 启用和禁用“等待可执行文件启动”

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

而且,该线程的每个解决方案: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.

在尝试了这些替代方案中的每一种之后,问题仅在装有 iOS 12 的设备上仍然存在。

Someone has an idea about how can solve this?

有人知道如何解决这个问题吗?

UPDATEI 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/[email protected]
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

采纳答案by JESERRANO

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

经过几天的研究并感谢@Little Green Viper 的帮助,我找到了一个解决方案。

Basically, some Apple Worldwide Developer Relations Certification Authorityweren'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.

基本上,一些Apple Worldwide Developer Relations Certification Authority在更新后没有工作,但它能够为 iOS 11 成功编译。然后,最大风险的解决方案是删除所有Apple Worldwide Developer Certificates,但在此之前,请尝试在 Mac 上创建一个新用户。

(System PreferencesUsers and groupsNew User) that should work.

System PreferencesUsers and groupsNew User)应该可以工作。

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.

现在您必须选择,在新用户中工作或重新签署证书。就我个人而言,我选择了第一个选项。

回答by Wangdu Lin

Haozes: I fixed it by doing this:

Haozes:我通过这样做修复了它:

  1. Open Edit Scheme
  2. Open Infotab
  3. Executablethen select?Ask on launch?
  1. 打开编辑方案
  2. 打开信息选项卡
  3. 可执行然后选择发射时问

Thank god!

感谢上帝!

Edit Scheme

编辑方案

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

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

回答by Linh Vo

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

我花了三天时间才解决问题。我找到了两个解决方案。您可以选择两种方式之一。

Solution 1:

解决方案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.

解决方案2:打开Keychain Access -> 选择System,All Items -> 删除证书Apple Worldwide Developer Relations Certification Authority。

Enter image description here

在此处输入图片说明

回答by Shane McCurdy

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.

我想稍微阐述一下答案,根据我在解决这个问题上所经历的和学到的东西,以及那些和我一样对 Xcode 和 iOS 开发不熟悉的人,提供更多的细节。和我的情况一样,我只需要让它尽可能快地运行。

My scenario was I have an Ionic3 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.

我的情况是我有一个Ionic3 iOS 应用程序在一些 iPad 上运行,供当地非营利组织作为接待台签到亭,所以这个应用程序不需要在商店中公开。几天后该应用程序崩溃了,然后经过数周的研究,我发现这是我的 Apple 开发者帐户,而不是错误或内存泄漏。

So I re-setup my Apple developer account, created new and updated signing certificates and Ad-hoc provisioning profileswith 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.

因此,我重新设置了我的 Apple 开发人员帐户,使用这些 iPad创建了新的和更新的签名证书和临时配置文件,这样它们就不会再崩溃了。我开始使用我闪亮的新证书和配置文件在设备上运行该应用程序......然后追逐这个“iPad已拒绝启动请求”的混乱几个小时。

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 Runon the left is selected, and then open the options for Executableon the right, under the Infotab. 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.

当您再次尝试运行应用程序时,会出现一个包含目标设备上可用应用程序的弹出窗口,您需要选择“appName.app”,然后单击Run

Select your "appName.app"

选择你的“appName.app”

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

没有看到您的“appName.app”?,那么这是全新安装,单击Cancel

Don't see your "appName.app"

看不到你的“appName.app”

If this is a fresh install, you will have to make sure Executableis 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 Executableto "Ask on Launch" and then Runagain. The "appName.app" should be in the list now.

如果这是全新安装,您必须确保将Executable设置为您的“appName.app”。它会拒绝您的第一次运行尝试,但它会在设备上安装该应用程序。然后返回并将可执行文件重置为“启动时询问”,然后Run再次重置。“appName.app”现在应该在列表中。

If editing your Run Schemedoesn'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.

我建议接下来查看您的 Apple 开发人员证书,并确保它们符合要求并且是最新的。

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

单击您的签名配置文件旁边的信息圆圈 (i) 图标,快速达到峰值。

Enter image description here

在此处输入图片说明

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

在此处管理您的证书... 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 下载您的证书,或者通过转到 Xcode → Preferences查看列出的证书:

Xcode → Preferences

Xcode → 首选项

Then make sure you are on the Accountstab, 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...

然后确保您位于“帐户”选项卡上,在左侧选择您的 Apple ID,然后查看右下角是否可以下载或管理/查看您的证书...

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

Xcode 10:iPhone 拒绝了启动请求

Good luck!

祝你好运

回答by gamal

For Xcode 10.v

对于 Xcode 10.v

1 -> Delete all developer certificates in keychain.

1 -> 删除keychain.

2 -> Remove AppleID from Xcode.

2 -> 从 Xcode 中删除 AppleID。

3 -> Restart Xcode.

3 -> 重新启动 Xcode。

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

4 -> 再次向 xcode 添加一个 AppleID(与之前的一样就可以了)。

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

5 -> 再次重启 Xcode,(最好重启你的 MAC)。

回答by Binshad

This issue can be resolved by unchecking Debug executablein Edit Scheme.

这个问题可以通过取消来解决调试可执行文件编辑方案

Enter image description here

在此处输入图片说明

回答by xuzepei

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

就我而言,项目无法使用指定证书在 iOS12+ 上启动,但可以用于其他 iOS 版本。

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
  1. 删除钥匙串->系统->所有项目->你的项目相关证书中的旧证书
  2. 重新安装证书
  3. 重启Xcode

enter image description here

enter image description here

Hopefully, this can save your time.

希望这可以节省您的时间。

回答by Lorenzo Santini

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:

查看钥匙串访问,搜索关键字“开发人员”,我发现我的 iPhone 证书被标记为红色的“无效”。所以这就是我所做的:

  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.
  1. 我打开钥匙串访问并搜索关键字“开发人员”。
  2. 我删除了“iPhone 开发人员”证书(如果您在使用另一台设备时遇到问题,请确保删除正确的)。
  3. 然后我也删除了“Apple Worldwide Developer Relations Certification Authority”和“Developer ID Certification Authority”。

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

之后一切照常运行,我已经能够在我的 iPhone 上启动该应用程序。

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

YouTube 上还有一个视频展示了这种方法。

回答by Robin Dinse

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:

就我而言,开发者帐户尚未在 iOS 设备上获得批准。我必须在“设置”应用程序中手动执行此操作:

  • Open the Settingsapp
  • Go to General
  • Go to Profiles & Device Management
  • Choose the profile profile in question and trust it
  • 打开设置应用
  • 转到一般
  • 转到配置文件和设备管理
  • 选择有问题的个人资料并信任它

回答by IceMan

Editing the ProductSchemeEdit SchemeInfo→ *Executable** to change to Ask on Launchworked. 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.

寻找更永久的解决方案,我如上所述删除了开发人员证书(解决方案 2:打开钥匙串访问→选择系统,所有项目→删除证书 Apple Worldwide Developer Relations Certification Authority**),但是当我重新启动 Xcode 时,我的应用程序不会以完全相同的行为在设备上启动。

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 IDsusing the Manage Certificatesbutton;
  4. Quit Xcode;
  5. Relaunch Xcode and the application.
  1. 从 Xcode Preferences 中删除 Apple ID;
  2. 重新启动 Xcode 以添加 Apple ID;
  3. 使用管理证书按钮在 Xcode PreferencesAccountsApple IDs 中添加新的 iOS 开发证书;
  4. 退出 Xcode;
  5. 重新启动 Xcode 和应用程序。

回答by JDL

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.

我今天遇到了这个问题,但上述解决方案都没有真正奏效。在关注了 iOS 12 和 XCode 似乎都想要的东西之后,似乎从 XCode 在设备上运行和调试时,iOS 需要开发人员配置文件而不是发布分发文件。尝试在设备上从 XCode 运行,同时使用非开发人员配置文件进行调试会导致一种或另一种形式的问题。

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.

在这方面,如果您使用手动配置文件,无论出于何种原因,您都需要两个。一个开发配置文件和一个分发配置文件,在设备上调试时使用开发配置文件。