echo "loading emulator" tools/emulator -avd Test -partition-size 128 & ./platform-tools/adb -s emulator-5554 wait-for-device echo 'Emulator ready, pushing hosts!' ./platform-tools/adb -s emulator-5554 remount ./platform-tools/adb -s emulator-5554 push hosts /etc/hosts echo 'done'
For testing a local website using a custom hosts file on the Android emulator you need to run a few commands. This script wraps them all so you can just do ./run_emulator and away you go.
Put a bash file with the content in the Android SDK root along with the hosts file you want to use (I called the script run_emulator.sh, but whatever):
Chmod it to be executable.
Assumes you already have an Android emulator called Test and are just running the one device.