Xcode 7.1:由于无法确认开发人员的身份,因此无法打开模拟器

时间:2015-10-29 11:38:00

标签: ios xcode ios-simulator osx-elcapitan xcode7.1

我已将Mac OS X升级到10.11.1 El Capitan。当我尝试在Xcode 7.1上运行应用程序时,我收到一条弹出消息,说明"模拟器"无法打开,因为无法确认开发者的身份。参考截图。

为什么会这样留言?我无法在Xcode 7.1上测试任何应用。

Screenshot for error

5 个答案:

答案 0 :(得分:11)

Apple believes is security that's the reason only apps which you have downloaded from App Store can be opened.

Well, to open any app which you have downloaded and install from anywhere you need to allow permission. To do so:

  1. Open 'System Preferences'
  2. Go to 'Security & Privacy' and tap on 'General' tab
  3. Click on 'Lock' icon which you can find on bottom left screen and type your administrator password.
  4. The last step is to choose 'Anywhere' under 'Allow apps downloaded from:' and then again click on 'Lock' icon.
  5. That's it. Now you can run any apps.

enter image description here

Enjoy!

答案 1 :(得分:10)

Gatekeeper要求验证从互联网下载的每个应用程序。自从你下载"模拟器"使用Safari时,必须检查并将其添加到已接受的应用程序列表中。这是一个快速的方法:

  1. 运行Terminal.app
  2. 输入以下命令sudo xattr -d com.apple.quarantine /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
  3. 我找到了答案here

答案 2 :(得分:4)

Simulator.app is distributed by Apple and should be codesigned appropriately.

The dialog you are seeing indicates that the version you have did not pass Gatekeeper's codesignature checks.

Possible causes:

  1. You made local modifications to Xcode.app or Simulator.app to invalidate Apple's code signature.
  2. 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.
  3. 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.
  4. The Simulator.app you are trying to open is not actually Xcode's.
  5. A bug in Gatekeeper or OS X might be triggering a false result.

Please also update your question with the output of the following steps (assuming you've setup xcode-select appropriately) for additional support:

codesign -vvv -d $(xcode-select -p)/Applications/Simulator.app
codesign -vvv $(xcode-select -p)/Applications/Simulator.app

答案 3 :(得分:4)

当我在实际打开Xcode之前运行直接启动模拟器的构建脚本时,发生了这种情况。

当您第一次打开Xcode时,它将经历需要很长时间的验证过程。完成后,将验证捆绑包的内容,您可以在没有警告的情况下使用模拟器。

如果您在验证后仍然收到警告,则可能会损害您的Xcode版本。

这可能是一个错误,网守没有警告您父包未经过验证。

答案 4 :(得分:0)

在我的情况下,我有多个Simulator.app实例(有些直接从Apple网站下载,而不是从商店安装)。当我发布open -b com.apple.iphonesimulator时,其中一个已下载的模拟器已打开,而不是/Applications/Xcode.app中的当前模拟器。我将命令更改为open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app,问题现已解决。