Jay Q.
Jay Q.

Reputation: 4999

iOS Simulator NSPOSIXErrorDomain Code=2 after upgrading to OSX El Capitan

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

Upvotes: 11

Views: 7819

Answers (4)

Jay Q.
Jay Q.

Reputation: 4999

Problem was fixed after upgrading to 7.2.

Upvotes: 2

Hai Feng Kao
Hai Feng Kao

Reputation: 5298

Using Charles can solve this problem miraculously. Just keep Charles opened, and the problem will go away.

Upvotes: 1

Moe Salih
Moe Salih

Reputation: 723

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)"

Upvotes: 7

Aleksey Mazurenko
Aleksey Mazurenko

Reputation: 643

Looks like this problem persists only on simulator while real device work as expected

Upvotes: 2

Related Questions