# 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:
    
* ```bash
    emulator <avd-name> -writeable-system
    ```
    
* Set adb to root
    
* ```bash
    adb root
    ```
    
* Remount filesystem
    
* ```bash
    adb remount
    ```
    
* Log into the simulator shell
    
* ```bash
    adb shell
    ```
    
* Edit the hosts file
    
* ```bash
    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.
