Editing the iPhone Simulator hosts file
问题 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) 回答1: 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. 来源: https://stackoverflow.com/questions/3648764