当我使用Xcode 9.0下载模拟器(Xcode - 首选项 - 组件 - 模拟器)时,它将显示“无法下载并安装iOS 8.1模拟器。此服务器的证书无效。您可能连接到的服务器是假装是“devimages.apple.com.edgekey.net”,这可能会使您的机密信息处于危险之中。“
我发现我可以下载适用于iOS10.0及更高版本的模拟器,但我无法下载iOS 10.0以下的模拟器。 如你所见:
/Users/Andy/Library/Caches/com.apple.dt.Xcode/Downloads
)Xcode-Preferences
下载并安装模拟器。答案 0 :(得分:21)
如果您更新证书信任设置,我实际上找到了另一种方法。浏览Safari中的https://devimages.apple.com.edgekey.net/downloads/xcode/simulators
。你会看到这个:
如果您点击"访问此网站",则会提示您输入管理员凭据以更新您的证书信任设置。这样做之后,下载链接就像正常一样在Xcode中工作。
答案 1 :(得分:16)
看起来像网络问题,您可以查看日志并通过浏览器下载相关的.dmg
文件。见日志:
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
Password:
2017-09-27 09:35:05.531 Xcode[24753:3375917] plugin com.apple.dt.XCDocumenter.XCDocumenterExtension interrupted
2017-09-27 09:35:05.567 Xcode[24753:3376388] Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.dt.XCDocumenter.XCDocumenterExtension" UserInfo={NSDebugDescription=connection to service named com.apple.dt.XCDocu
), NSUnderlyingError=0x7fb6702b4c00 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk." UserInfo={NSErrorFailingURLStringKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9813, kCFStreamPropertySSLPeerCertificates=(
"<SecCertificate 0x7fb674e40f80 [0x7fff78314440]>",
"<SecCertificate 0x7fb674ef4770 [0x7fff78314440]>"
), _kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrust 0x7fb674da1550 [0x7fff78314440]>, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk., _kCFStreamErrorDomainKey=3, NSErrorFailingURLKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg, _kCFStreamErrorCodeKey=-9813}}, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk., NSErrorFailingURLKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg, NSErrorFailingURLStringKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg, NSErrorClientCertificateStateKey=0}
2017-09-27 10:05:14.344 Xcode[24909:3382580] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2017-09-27 10:05:14.513 Xcode[24909:3382580] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
将下载的.dmg
文件移至com.apple.dt.Xcode/Downloads
目录。要执行此操作,请在Finder中打开~/Library/Caches
并显示com.apple.dt.Xcode
并转到Downloads
。
注意:com.apple.dt.Xcode不是真正的“目录”。这是一个包裹。但是我们仍然可以通过右键单击文件并单击“显示包内容”
来访问它的内容
Xcode->Preferences->Component
并点击相关模拟器继续安装下载文件可选:如果仍然出现私有连接错误,则重新启动Xcode。做第3步。
答案 2 :(得分:3)
我切换到另一个网络并下载必要的模拟器。 (我的同事们也遇到了同样的问题以及上面的解决方案)
尝试更改您的网络,并确保您未与任何代理服务器连接。
希望这会帮助你。