Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 794
Shiki Avatar asked Sep 06 '10 02:09

Shiki


People also ask

Can you edit hosts file on iPhone?

Jailbreak your iPhone, download iFile, navigate to /etc/ and open the file called hosts in the text viewer. Now you can edit it.

Does iOS have a hosts file?

An iOS does have a hosts file and it incorporates IP addresses and hostnames mappings. This is the same as DNS, though you can control it locally and does take emphasis over the DNS. This enables you to put in local and manual overrides for the entries.

Where does the iPhone simulator store its data?

type: ~/Library/Application Support/iPhone Simulator.


1 Answers

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.

like image 139
BoltClock Avatar answered Sep 30 '22 01:09

BoltClock