iOS 模擬器運行不能聯網 PAC Fetch failed with error
app在模擬器是哪個啟動成功會自動連接服務器,然後Xcode控制臺報錯,
模擬器 PAC Fetch failed with error [NSURLErrorDomain:-1001]
這類問題有好多類似的錯誤代碼,看英文可以大概知道他的意思,-1001 代碼是超時之類的錯誤。PAC 是 (代理自動配置),然後我們可以在系統偏好設置->網絡->高級->代理 發現有代理錯誤。可以發現如果有比較詭異的代理,需要手動清除,或者是你開了科學上網自動代理的工具。請先退出這些軟件,然後再用模擬器打開app,可以正常聯網了。PAC錯誤的日誌可能還在。不過-1001錯誤消失了。
kCFURLErrorUnknown = -998,
kCFURLErrorCancelled = -999,
kCFURLErrorBadURL = -1000,
kCFURLErrorTimedOut = -1001,
kCFURLErrorUnsupportedURL = -1002,
kCFURLErrorCannotFindHost = -1003,
kCFURLErrorCannotConnectToHost = -1004,
kCFURLErrorNetworkConnectionLost = -1005,
kCFURLErrorDNSLookupFailed = -1006,
kCFURLErrorHTTPTooManyRedirects = -1007,
kCFURLErrorResourceUnavailable = -1008,
kCFURLErrorNotConnectedToInternet = -1009,
kCFURLErrorRedirectToNonExistentLocation = -1010,
kCFURLErrorBadServerResponse = -1011,
kCFURLErrorUserCancelledAuthentication = -1012,
kCFURLErrorUserAuthenticationRequired = -1013,
kCFURLErrorZeroByteResource = -1014,
kCFURLErrorCannotDecodeRawData = -1015,
kCFURLErrorCannotDecodeContentData = -1016,
kCFURLErrorCannotParseResponse = -1017,
kCFURLErrorInternationalRoamingOff = -1018,
kCFURLErrorCallIsActive = -1019,
kCFURLErrorDataNotAllowed = -1020,
kCFURLErrorRequestBodyStreamExhausted = -1021,
kCFURLErrorFileDoesNotExist = -1100,
kCFURLErrorFileIsDirectory = -1101,
kCFURLErrorNoPermissionsToReadFile = -1102,
kCFURLErrorDataLengthExceedsMaximum = -1103,
iOS 模擬器運行不能聯網 PAC Fetch failed with error