Modifying Android `hosts` File

Make sure to run your emulator as writable, by using the command below:

$ emulator -avd <EMULATORNAME> -writable-system

Then remount the file system:

$ adb root
$ adb remount
$ adb push hosts system/etc/hosts

Note, your machine IP should be 10.0.2.2.

--

--

--

Software Engineer at Taxfix (https://taxfix.de) - Software engineer, writer, designer, and artist.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aditya Purwa

Aditya Purwa

Software Engineer at Taxfix (https://taxfix.de) - Software engineer, writer, designer, and artist.

More from Medium

How to Mute Audio and Adjust Volume During a Video Call in Android Using the Agora SDK

Android ViewModel and ViewModel Factory

HTTP OR HTTPS REQUEST IN ANDROID PIE

KMM — Publish Android / JVM SDK Binaries