ios Xcode 9 错误:“iPhone 已拒绝启动请求”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45421179/
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
Xcode 9 error: "iPhone has denied the launch request"
提问by user1988824
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:
使用 Xcode beta 9 (v4),我试图通过单击“播放”按钮来启动应用程序。我得到一个“构建成功”但就在启动之前,Xcode 中出现一条弹出消息:
"iPhone has denied the launch request."
“iPhone 拒绝了启动请求。”
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.
昨天还可以用。它确实在模拟器上工作。我重新启动了我的电脑,iPhone,卸载了应用程序,清理了构建。没有想法了。
回答by Nikhlesh Bagdiya
It may be code sign issue. Make sure you're signing with developer, not distribution.
这可能是代码符号问题。确保您与开发人员签署,而不是分发。
回答by Brian M
It happens using Xcode 9.x or newer.
它发生在使用 Xcode 9.x 或更新版本时。
I tracked this problem down to the "debug executable" checkbox in the product scheme (product->scheme->edit scheme->info->debug executable checkbox). I uncheckedthat and this stopped happening (as well as a couple other weird issues - no output in console being one).
我将这个问题追溯到产品方案中的“调试可执行文件”复选框(产品->方案->编辑方案->信息->调试可执行文件复选框)。我取消了检查,这不再发生(以及其他一些奇怪的问题 - 控制台中没有输出是一个)。
回答by Rio Weber
I have a workaround:
If you change the scheme to 'Ask on Launch' it works.
我有一个解决方法:
如果您将方案更改为“启动时询问”,它会起作用。
In Xcode top bar
在 Xcode 顶部栏中
Product > Scheme > Edit Scheme > 'Info' tab > Executable: "Ask on Launch"
It's slightly annoying but it works.
这有点烦人,但它有效。
回答by Binshad
回答by Nastya Gorban
After getting "denied launch request" error, do this:
收到“拒绝启动请求”错误后,请执行以下操作:
Edit Scheme -> Info -> Executable -> Ask on Launch
编辑方案 -> 信息 -> 可执行文件 -> 启动时询问
This worked for me with adhoc profile.
这对我来说是临时配置文件。
回答by Antonin Charvat
Simple restarting of the iPhone helped me out.
简单地重新启动 iPhone 帮助了我。
回答by Shyam
For me issue was due to code signing the app with Ad hoc profile.
对我来说,问题是由于使用 Ad hoc 配置文件对应用程序进行了代码签名。
After changing the code signing to developer profile,from xcode settings general tab the above issue got resolved.
将代码签名更改为开发人员配置文件后,从 xcode 设置常规选项卡中,上述问题得到解决。
回答by KameshiOS
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.
我最近遇到了这个问题,我找到了这个疯狂问题的解决方案。这是解决此问题的方案问题,请按照以下步骤操作。
- Click Edit Scheme top Navigator Tab.
- 单击“编辑方案”顶部的“导航器”选项卡。
- Click Info on Run menu.
- On Executable dropdown select "Ask on Launch" option -> Then Close and run the build once.
- 单击运行菜单上的信息。
- 在 Executable 下拉列表中选择“启动时询问”选项 -> 然后关闭并运行一次构建。
This solved my problem when I got this issue.
当我遇到这个问题时,这解决了我的问题。
回答by Mr Rogers
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)
我的问题是我使用的是免费的开发者帐户(只需使用我的 Apple ID 登录)。查看我发现的设备日志时(粗体添加)
(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 theuser")"
(请求被拒绝); 原因:“该请求被服务委托 (SBMainWorkspace) 拒绝,原因是:安全性(“无法启动 {com.my.bundleID},因为它的代码签名无效、权限不足或其配置文件未被用户明确信任")"
That made me realize that I needed to go into Settings
-> General
-> Device Management
-> {My Apple ID}
-> Trust
这让我意识到我需要进入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.
在以前的 iOS 版本中,我会在我的设备上遇到一个对话框,告诉我这是问题所在。也许苹果将其用于 iOS 11。
回答by chbrown
Got this with Xcode 9.0 while deploying to a non-simulated iPhone 6s with iOS 10.3.
在使用 iOS 10.3 部署到非模拟 iPhone 6s 时,使用 Xcode 9.0 得到了这个。
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.
在出现这种情况之前,我已经强制退出了该应用程序。否则,什么都没有改变;所有开发人员签名凭据仍然受信任,并且该应用程序仍然在 iPhone 的设置中标记为已验证。
The trick that fixed it was turning the iPhone off and then turning it back on again.
修复它的技巧是关闭 iPhone,然后再次打开它。
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?
查看我的日志,它似乎applicationWillTerminate
是在发生这种情况之前触发的;我认为我强制退出的应用程序实例一定是某个僵尸进程?