I have a client-server App, in order to test it with Simulator I have a server on a virtual machine and I change mac\'s hosts file (/etc/hosts) so I can get there.
I
Make sure you add each host alias on different line:
# Wrong!
127.0.0.1 example.com www.example.com
# Good
127.0.0.1 example.com
127.0.0.1 www.example.com
I had the same issue with Xcode 6.
There is a bug or behaviour change in OSX related to /etc/hosts
.
If I add more host aliases on the same line in OSX's /etc/hosts
file, iOS simulator gives me the same error.
But if I add each host alias on it's own line, iOS simulator works as I expect it to.
Have you tried flushing the DNS cache with the command
sudo dscacheutil -flushcache
before quitting and relaunching the iOS Simulator ?