I had to edit my emulator' hosts file in order to connect to a local development environment. I have followed this steps:
Run the emulator:
~/Library/Android/sdk/tools/emulator -writable-system -avd Nexus_5_API_19
In another terminal/cmd prompt:
adb reboot
adb root
adb -s emulator-5554 remount
adb -s emulator-5554 pull /system/etc/hosts hosts
add the IP to host file
adb -s emulator-5554 push hosts /system/etc/hosts
adb reboot
Now whenever I try to start my emulator from AVD Manager it is not responding. I always have to start it with:
~/Library/Android/sdk/tools/emulator -writable-system -avd Nexus_5_API_19
I mention that I work from High Sierra.
Mention: I have tried with adb
to make my emulator rw
but it did not allow me to push my hosts file.