How to Modify Android Emulator Hosts file


How to Modify Android Emulator Hosts file

Posted: February 22, 2011 in Android
Tags: 

Modifying hosts file is very important and useful trick for web development. Android hosts file is located in /system/etc/ directory.

Below is the steps to modify Android emulator hosts file.

  • emulator -avd you_avd_name -partition-size 128. Start emulator from command line. I have tried to start emulator via Android SDK Manager, but kept geting Out of Memory when pushing back the file.
  • adb remount. Remount the file system, otherwise when pushing back the file, you will get error: read-only file system.
  • adb pull /system/etc/hosts /your/local/path. Pull the hosts file from emulator.
  • adb push /your/local/path/hosts /system/etc. Push back the hosts file with your changes.

For locked android phone, we need unlock it to gain the root privileges first.

 

Source : http://believeinmiraclesx.wordpress.com/2011/02/22/how-to-modify-android-emulator-hosts-file/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s