Sync your hosts file to the Android emulator with aemu
The Android emulator has become a lot more usable since the use of HAXM, but there are still a few annoyances, like the fact that the host OS’s ‘hosts’ file isn’t used during name resolution.
Editing the hosts file on the emulator itself is very difficult, time-consuming and error-prone. I really don’t want to have to do that every time I need to use the emulator to test a local host.
So I’ve written a bunch of tools for the emulator called aemu and one of the packaged tools is called aemu-hosts. It allows you to launch a virtual device and sync your hosts file to it in one command.
Also included is aemu-sms, which I’m using as a hacky way to ‘paste’ things into the running virtual device, as there’s no normal copy/paste functionality.