Wednesday, May 23, 2012

Add Host Entries in Android Emulator

You can add host entries in the android emulator using the following commands.
1. You need to mount the android emulator's file system in read write mode.
2. Then upload the modified host entry to /system/etc/
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system #mount as rw
adb push hosts /system/etc/ #where hosts file contain our modified host entries
However the changes does not seem to persist. So we need run this script every time we start the emulator.