cd ${ANDROID_HOME}/emulator
./emulator -list-avds
./emulator -avd $(./emulator -list-avds) -writable-system
cd ${ANDROID_HOME}/tools
adb root
adb remount
adb pull /system/etc/hosts ~/Downloads/hosts
echo '192.168.0.17 www.test.com' >> ~/Downloads/hosts
adb push ~/Downloads/hosts /system/etc/hosts
adb reboot
The host file might be in a