During development I always have to change the hosts file on emulator using following commands in order to map the 10.0.2.2 ip address to dns name. This always worked on Android ADT. But recently I switched to Android Studio and it has stopped working on x86 images. It works for ARM images but those are really slow.
I am doing development on ... Android Studio 2.1.2 Android Platform-tools 24 Android SDK Tools 25.1.7
I use following commands from terminal window in order to do it
adb remount
adb shell
echo '10.0.2.2 xxxx' >>/etc/hosts
I get Read-only File system errors.
UPDATE: Looks like this is a bug in Android tools 25.1.7. I downgraded my tools to 24.1.1 and it is all working. The latest tools is mounting the /system as read only and doesn't allow to be remounted as read write