升級(jí)到Xcode9.0以后,去下載模擬器,發(fā)現(xiàn)提示“Could not download and install iOS 9.3 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.”的錯(cuò)誤
看起來(lái)是個(gè)https證書驗(yàn)證的問(wèn)題巢价,那怎么做呢粱甫?
- 通過(guò)終端命令打開(kāi)Xcode
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
- 打開(kāi)下載模擬器的窗口
Xcode-Preferences-Components
點(diǎn)擊iOS9.3 Simulator
苇本,彈出窗口淫茵,提示警告美莫。 - 查看終端的輸出
2017-09-30 13:43:09.368 Xcode[3443:318102] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843)
2017-09-30 13:43:09.372 Xcode[3443:318051] [MT] DVTDownloadable: Error Domain=NSURLErrorDomain Code=-1202 "Could not download and install iOS 9.3 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." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7f9c412b1dc0>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSErrorFailingURLStringKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSErrorPeerCertificateChainKey=(
"<cert(0x7f9c5e340200) s: *.test.edgekey.net i: Symantec Class 3 Secure Server CA - G4>",
"<cert(0x7f9c5e340c00) s: Symantec Class 3 Secure Server CA - G4 i: VeriSign Class 3 Public Primary Certification Authority - G5>"
), NSErrorClientCertificateStateKey=0, NSLocalizedDescription=Could not download and install iOS 9.3 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., _kCFStreamErrorDomainKey=3, NSUnderlyingError=0x7f9c41374bc0 {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_3-9.3.1.1460411551.dmg, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9843, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x7f9c5e340200) s: *.test.edgekey.net i: Symantec Class 3 Secure Server CA - G4>",
"<cert(0x7f9c5e340c00) s: Symantec Class 3 Secure Server CA - G4 i: VeriSign Class 3 Public Primary Certification Authority - G5>"
), _kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x7f9c412b1dc0>, 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_3-9.3.1.1460411551.dmg, _kCFStreamErrorCodeKey=-9843}}, _kCFStreamErrorCodeKey=-9843}
2017-09-30 13:43:09.372 Xcode[3443:318066] DVTDownloadable: Download Failed. Downloadable: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg. Error Domain=NSURLErrorDomain 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={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7f9c412b1dc0>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9843, NSErrorPeerCertificateChainKey=(
"<cert(0x7f9c5e340200) s: *.test.edgekey.net i: Symantec Class 3 Secure Server CA - G4>",
"<cert(0x7f9c5e340c00) s: Symantec Class 3 Secure Server CA - G4 i: VeriSign Class 3 Public Primary Certification Authority - G5>"
), NSUnderlyingError=0x7f9c41374bc0 {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_3-9.3.1.1460411551.dmg, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9843, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x7f9c5e340200) s: *.test.edgekey.net i: Symantec Class 3 Secure Server CA - G4>",
"<cert(0x7f9c5e340c00) s: Symantec Class 3 Secure Server CA - G4 i: VeriSign Class 3 Public Primary Certification Authority - G5>"
), _kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x7f9c412b1dc0>, 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_3-9.3.1.1460411551.dmg, _kCFStreamErrorCodeKey=-9843}}, 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_3-9.3.1.1460411551.dmg, NSErrorFailingURLStringKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSErrorClientCertificateStateKey=0}
2017-09-30 13:55:29.805 Xcode[3443:318051] Unknown class GPUTesselationSliderCell in Interface Builder file.
2017-09-30 13:55:34.791 Xcode[3443:318051] Could not find image named 'DVTInFieldChooseButtonSmall'.
2017-09-30 13:55:35.089 Xcode[3443:318051] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-13247/IDEKit/NavigableItems/IDENavigableItem.m:1175
Details: No match from <IDEKeyDrivenNavigableItem 0x7f9c5cb31960: (supports Any NSObject, represents: <Xcode3EditingGroup: 0x7f9c597a7200>)> to <Xcode3Target:0x7f9c5975de00:TestProject>. Iterating the whole tree might have taken a significant amount of time.
Object: <IDEKeyDrivenNavigableItem_Xcode3EditingGroup_Any: 0x7f9c5cb31960>
Method: -_descendantItemForRepresentedObject:stopAtClass:
Thread: <NSThread: 0x7f9c50407620>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
- 查看輸出的下載地址
https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg
页眯,將下載地址 copy到瀏覽器中,發(fā)現(xiàn)提示
截圖-1.png
點(diǎn)擊訪問(wèn)此網(wǎng)站,既可以下載模擬器文件 - 將下載好的文件
*.dmg
拖到com.apple.dt.Xcode/Downloads
文件夾中厢呵,通過(guò)終端open ~/Library/Caches
,找到com.apple.dt.Xcode
窝撵,點(diǎn)擊右鍵,選擇顯示包內(nèi)容
,如果里面沒(méi)有Downloads文件夾襟铭,則新建碌奉,完成后,將*.dmg
拖到這里面 - 回到窗口
Xcode-Preferences-Components
蝌矛,再次點(diǎn)擊剛才點(diǎn)擊過(guò)的iOS9.3 Simulator
直接跳過(guò)下載道批,直接安裝了。 - 在安裝其他版本的模擬器入撒,就可以直接在
Xcode-Preferences-Components
點(diǎn)擊就能下載了隆豹,這算不算Apple的bug呢。