Android - Modify hosts file

I use Cordova to bundle a web application as a native app for ease of distribution.
To test the site locally, but on the simulator, I needed to modify the hosts file on the Android simulator to point the test domain to the host machine:
Start the emulator in writeable mode:
emulator <avd-name> -writeable-systemSet adb to root
adb rootRemount filesystem
adb remountLog into the simulator shell
adb shellEdit the hosts file
vi /system/etc/hosts
After this, you should be able to access the FQDN on the simulator, which will now be pointing to the specified IP.


