无法下载 iOS 8.1 模拟器
Could not download iOS 8.1 Simulator
当我使用Xcode 9.0下载模拟器时(Xcode - 首选项 - 组件 - 模拟器),它会显示 "Could not download and install iOS 8.1 Simulator. 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."
更详细的问题
发现iOS10.0以上的模拟器可以下载,但是iOS10.0以下的模拟器下载不了。
如您所见:
- 当我点击下载iOS10.0以上的模拟器时,就可以了
- 但是我下载iOS10.0以下的模拟器时,会出现警告
我试过这个解决方案:
- 复制.dmg后缀的下载地址(https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg来自@MesutGÜNEŞ的回答),在Safari浏览器中打开
- 浏览器会显示服务器证书无效的警告,并自动禁止继续访问URL。
- 点击"visit the site"即可在浏览器下载模拟器安装包
- 安装包下载完成后,将安装包拖到缓存中。目录(
/Users/Andy/Library/Caches/com.apple.dt.Xcode/Downloads
)
- 打开
Xcode-Preferences
下载并安装模拟器。
- 所以直接把安装包提前放到缓存目录下,为了下载更快。但问题是这个警告 window 阻止我开始下载。我下载了安装包,还是安装不了
几个月前我遇到了同样的问题,问题出在我的网络上(在我的情况下,对各种网站的访问在办公室被阻止)。
我切换到另一个网络并下载了必要的模拟器。 (我的同事也有同样的问题,上面的解决方案有效)
尝试更改您的网络并确保您没有连接到任何代理服务器。
希望这对您有所帮助。
似乎是网络问题,您可以查看日志并通过浏览器下载相关的.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)
可下载 link 在日志中:https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg
将下载的 .dmg
文件移动到 com.apple.dt.Xcode/Downloads
目录。为此,在 finder 中打开 ~/Library/Caches
并显示 com.apple.dt.Xcode
并转到 Downloads
.
Note: com.apple.dt.Xcode isn’t a true “directory”. It's a package. But we can still access it’s contents by right clicking on the file and clicking “Show Package Contents”
- 打开
Xcode->Preferences->Component
并单击相关模拟器以使用下载的文件继续安装
可选:重新启动Xcode 如果它仍然给出私人连接错误并执行第 3 步。
如果您愿意更新证书信任设置,我实际上找到了另一种方法。在 Safari 中浏览至 https://devimages.apple.com.edgekey.net/downloads/xcode/simulators
。你会看到这个:
如果您点击 "visit this website",那么它会提示您提供管理员凭据以更新您的证书信任设置。这样做之后,下载链接在 Xcode 中正常工作。
当我使用Xcode 9.0下载模拟器时(Xcode - 首选项 - 组件 - 模拟器),它会显示 "Could not download and install iOS 8.1 Simulator. 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."
更详细的问题
发现iOS10.0以上的模拟器可以下载,但是iOS10.0以下的模拟器下载不了。 如您所见:
- 当我点击下载iOS10.0以上的模拟器时,就可以了
- 但是我下载iOS10.0以下的模拟器时,会出现警告
我试过这个解决方案:
- 复制.dmg后缀的下载地址(https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg来自@MesutGÜNEŞ的回答),在Safari浏览器中打开
- 浏览器会显示服务器证书无效的警告,并自动禁止继续访问URL。
- 点击"visit the site"即可在浏览器下载模拟器安装包
- 安装包下载完成后,将安装包拖到缓存中。目录(
/Users/Andy/Library/Caches/com.apple.dt.Xcode/Downloads
) - 打开
Xcode-Preferences
下载并安装模拟器。 - 所以直接把安装包提前放到缓存目录下,为了下载更快。但问题是这个警告 window 阻止我开始下载。我下载了安装包,还是安装不了
几个月前我遇到了同样的问题,问题出在我的网络上(在我的情况下,对各种网站的访问在办公室被阻止)。
我切换到另一个网络并下载了必要的模拟器。 (我的同事也有同样的问题,上面的解决方案有效)
尝试更改您的网络并确保您没有连接到任何代理服务器。
希望这对您有所帮助。
似乎是网络问题,您可以查看日志并通过浏览器下载相关的.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)
可下载 link 在日志中:https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_2-9.2.1.1451951473.dmg
将下载的
.dmg
文件移动到com.apple.dt.Xcode/Downloads
目录。为此,在 finder 中打开~/Library/Caches
并显示com.apple.dt.Xcode
并转到Downloads
.
Note: com.apple.dt.Xcode isn’t a true “directory”. It's a package. But we can still access it’s contents by right clicking on the file and clicking “Show Package Contents”
- 打开
Xcode->Preferences->Component
并单击相关模拟器以使用下载的文件继续安装
可选:重新启动Xcode 如果它仍然给出私人连接错误并执行第 3 步。
如果您愿意更新证书信任设置,我实际上找到了另一种方法。在 Safari 中浏览至 https://devimages.apple.com.edgekey.net/downloads/xcode/simulators
。你会看到这个:
如果您点击 "visit this website",那么它会提示您提供管理员凭据以更新您的证书信任设置。这样做之后,下载链接在 Xcode 中正常工作。