简体   繁体   中英

iOS simulator cant connect to local network IP address

To start, I used to be able to access locally hosted files on my simulator app with no problem.

After updating to OS X Yosemite, I can't connect to addresses like http://192.168.2.6:8000 on my iOS simulator, that work fine in Chrome, or from my actual phone.

Is there a new setting I need to enable for local testing? Or are there any other potential issues for me to look at?

The error I get on safari (on iOS simulator) is:

The error was: "The operation couldn't be completed. No such file or directory".

And looking in the system.log I see this:

Oct 13 16:40:46 My-MacBook-Pro MobileSafari[4215]: tcp_connection_set_tfo 89 TFO is not yet supported on Simulator

This problem solved completely with iOS 9.2 and Xcode 7.2 : https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html#//apple_ref/doc/uid/TP40016994-CH5-SW2

However, based on official releases notes of Xcode 7.2, it is still known issue for previous iOS versions (I checked it for iOS 8.2, but there is no problem anymore). You could use your loopback address (127.0.0.1 or localhost) for older versions.

This is a known issue that I believe was mentioned in the Xcode release notes. Unfortunately, the only workaround at this time is to user the loopback interface (ie: 127.0.0.1) for your testing needs.

Sounds to me like a warning that http is going to be frowned on. eg:

in UIWebView you cannot open, by default, an http// web-page

if you then open an https// web-page it opens but any images,etc. in it that refer to http// websites fail to load

I've just dealt with all that stuff, it certainly happens with the latest mac OS and the latest Xcode

Phil

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM