Posted by & filed under Web Development.

Some Android emulator tricks which include performance boosting, making use of Android’s /etc/hosts file, and enabling the Javascript console

Some Android emulator tricks:

Performance Boosting

Run the Android emulator via Linux, it seems to be much faster there (at least in comparison to OS X) – so much so that it might even be faster running in a Linux VM. If you do not work from within Linux you can access the emulator via SSH X11 forwarding (i.e. ssh -X username@host /path/to/android). Also, it seems like the Intel CPUs run a little faster than the ARM ones, although some older Android versions seem to require ARM. Using the host GPU can improve performance too, although this feature doesn’t seem to work with X11 forwarding.

Make use of Android’s /etc/hosts file

  1. ./sdk/platform-tools/adb remount
  2. ./sdk/platform-tools/adb pull /system/etc/hosts ~/   (this copies the Android /etc/hosts file to your home directory)
  3. edit the hosts file that has been copied to your home directory as needed
  4. ./sdk/platform-tools/adb push ~/hosts /system/etc

I haven’t tested to see whether these changes can be retained across multiple emulator sessions using the snapshot feature

Output the Javascript console to stdout

adb logcat browser:V *:S