Android - Modify Virtual Device Hosts File

1. emulator -avd “avd_name” -partition-size 128 -> let system partition have enough space to write

2. adb root -> restarts the adbd daemon with root permissions

3. adb remount -> remounts the /system partition on the device read-write

4. adb pull /system/etc/hosts “local location”

5. modify the hosts file on the “local location”. 10.0.2.2 is your development machine

6. adb push “local location” /system/etc/hosts