views:

57

answers:

1

Hi, is it possible to edit the hosts file of the iPhone simulator?

I'm working on a REST API and I need to be able to access my local site using a correct domain (e.g. http://api.local.com)

+2  A: 

You can simply edit your Mac's /etc/hosts file and iPhone Simulator will adopt whatever is set there.

It works because the iPhone Simulator simply provides a simulated frontend of Mobile Safari's user interface, which just uses your Mac's network settings.

BoltClock
Thanks! It worked.
Shiki