After I upgraded from Yosemite to El Capitan, my simulator can no longer connect to my local server. The same simulator has no problems connecting to my remote production server.
I'm sure my local server is running fine as Safari can connect to it properly using the same port.
Here's the error I'm getting in Xcode:
Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSErrorFailingURLStringKey=http://localhost:9000/sites, NSErrorFailingURLKey=http://localhost:9000/site, _kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
I'm running xcode 7.0.1 Simulator iOS 9.0
This is a known bug according to the Xcode 7.1 beta 3 release notes: "When running in the iOS simulator, an app cannot communicate with TCP/IP services locally hosted by the Mac. (22453539)"
Looks like this problem persists only on simulator while real device work as expected
Problem was fixed after upgrading to 7.2.
Using Charles can solve this problem miraculously. Just keep Charles opened, and the problem will go away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With