Xcode 7.1:无法打开模拟器,因为无法确认开发者的身份
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33413180/
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 7.1 : Simulator can't be opened because the identity of developer cannot be confirmed
提问by Jayprakash Dubey
I've upgraded my Mac OS X to 10.11.1 El Capitan. When I try to run app on Xcode 7.1 I'm getting an pop message stating "Simulator" can't be opened because the identity of the developer cannot be confirmed. Refer screenshot.
我已将 Mac OS X 升级到 10.11.1 El Capitan。当我尝试在 Xcode 7.1 上运行应用程序时,我收到一条弹出消息,指出无法打开“模拟器”,因为无法确认开发人员的身份。参考截图。
Why this message? I'm not able to test any app on Xcode 7.1.
为什么是这个消息?我无法在 Xcode 7.1 上测试任何应用程序。
回答by Sohil R. Memon
Apple believes is security that's the reason only apps which you have downloaded from App Store can be opened.
Apple 认为安全是只有您从 App Store 下载的应用程序才能打开的原因。
Well, to open any app which you have downloaded and install from anywhere you need to allow permission. To do so:
好吧,要打开您从任何地方下载并安装的任何应用程序,您都需要获得许可。这样做:
- Open 'System Preferences'
- Go to 'Security & Privacy' and tap on 'General' tab
- Click on 'Lock' icon which you can find on bottom left screen and type your administrator password.
- The last step is to choose 'Anywhere' under 'Allow apps downloaded from:' and then again click on 'Lock' icon.
- That's it. Now you can run any apps.
- 打开“系统偏好设置”
- 转到“安全和隐私”并点击“常规”选项卡
- 单击屏幕左下角的“锁定”图标,然后输入管理员密码。
- 最后一步是在“允许从以下位置下载应用程序”下选择“任何地方”,然后再次单击“锁定”图标。
- 就是这样。现在您可以运行任何应用程序。
Enjoy!
享受!
回答by buster
Gatekeeper requires that every application downloaded from the internet is verified. Since you downloaded "Simulator" with Safari it has to be checked and added to a list of accepted applications. Here is a quick way to do that:
Gatekeeper 要求从 Internet 下载的每个应用程序都经过验证。由于您使用 Safari 下载了“模拟器”,因此必须对其进行检查并将其添加到已接受的应用程序列表中。这是一个快速的方法:
- Run Terminal.app
- Enter the following command
sudo xattr -d com.apple.quarantine /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
- 运行 Terminal.app
- 输入以下命令
sudo xattr -d com.apple.quarantine /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
I found the answer here.
我在这里找到了答案。
回答by Jeremy Huddleston Sequoia
Simulator.app is distributed by Apple and should be codesigned appropriately.
Simulator.app 由 Apple 分发,应进行适当的代码设计。
The dialog you are seeing indicates that the version you have did not pass Gatekeeper's codesignature checks.
您看到的对话框表明您拥有的版本没有通过 Gatekeeper 的代码签名检查。
Possible causes:
可能的原因:
- You made local modifications to Xcode.app or Simulator.app to invalidate Apple's code signature.
- Disk corruption or maybe an error in transport caused some resources in Simulator.app to not be valid such that the signature is no longer valid.
- You downloaded an unofficial copy of Xcode.app (or just Simulator.app) which has been modified by a 3rd party. Google "XcodeGhost" for information on why that's a bad idea.
- The Simulator.app you are trying to open is not actually Xcode's.
- A bug in Gatekeeper or OS X might be triggering a false result.
- 您对 Xcode.app 或 Simulator.app 进行了本地修改,以使 Apple 的代码签名无效。
- 磁盘损坏或传输错误导致 Simulator.app 中的某些资源无效,从而签名不再有效。
- 您下载了 Xcode.app(或只是 Simulator.app)的非官方副本,该副本已被第 3 方修改。谷歌“XcodeGhost”有关为什么这是一个坏主意的信息。
- 您尝试打开的 Simulator.app 实际上并不是 Xcode 的。
- Gatekeeper 或 OS X 中的错误可能会触发错误结果。
Please also update your question with the output of the following steps (assuming you've setup xcode-select appropriately) for additional support:
还请使用以下步骤的输出更新您的问题(假设您已正确设置 xcode-select)以获得额外支持:
codesign -vvv -d $(xcode-select -p)/Applications/Simulator.app
codesign -vvv $(xcode-select -p)/Applications/Simulator.app
回答by Sean Dawson
This happened to me when I ran a build script that launched the simulator directly, before actually opening Xcode.
当我在实际打开 Xcode 之前运行直接启动模拟器的构建脚本时,这发生在我身上。
When you open Xcode for the first time it will go through a verification process that takes a long time. After that completes, the contents of the bundle will be verified as well and you can use the simulator without the warning.
当您第一次打开 Xcode 时,它会经历一个需要很长时间的验证过程。完成后,捆绑包的内容也将被验证,您可以在没有警告的情况下使用模拟器。
If you still have the warning after verification your version of Xcode might be compromised.
如果您在验证后仍然收到警告,您的 Xcode 版本可能会受到影响。
It is possibly a bug that gatekeeper doesn't warn you that the parent bundle has not been verified.
可能是网守没有警告您父捆绑包尚未验证的错误。
回答by Ohad Schneider
In my case I had multiple instances of Simulator.app
present (some downloaded directly from Apple's site, rather than installed from the store). When I issued open -b com.apple.iphonesimulator
one of the downloaded simulators got opened, instead of the current one in /Applications/Xcode.app
. I changed my command to open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
and the issue is now resolved.
就我而言,我有多个Simulator.app
present实例(有些是直接从Apple网站下载的,而不是从商店安装的)。当我发布open -b com.apple.iphonesimulator
其中一个下载的模拟器时打开了,而不是当前的/Applications/Xcode.app
. 我将命令更改为open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
,问题现已解决。