How to edit /etc/hosts file in Android Studio emulator running in nougat?

1) android-sdk-macosx/tools/emulator -avd <avdname> -writable-system
2) ./adb root
3) ./adb remount
4) ./adb push <local>/hosts /etc/hosts

Android file host can be

/etc/hosts <--- This worked for me
/etc/system/hosts
/system/etc/hosts

Check

1) ./adb shell
2) cat /etc/hosts
3) ping customsite.com

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)