My development machine is simultaneously connected to two different networks. One is through ethernet (eth0), and the other is WiFi (en1). In this situation, the Android emulator appears to always want to reach out to the network on eth0. When starting the emulator from the command line, is there an option where I can tell it to use a specific network interface on the development machine (en1 in my case)?
It seems like this should be possible through args you can pass to the -qemu flag. However, the current version of the emulator will not start when you use this flag.
If you are only communicating with a specific address or subnet you can set up an apropriate route on the host machine by using the route add command. The syntax differs slightly for Windows and Linux:
Linux
route add -net target-ip netmask 255.255.255.0 metric 1 gw en1
Windows
route add target-ip mask 255.255.255.0 en1-gw-address metric 1 -p
You might want to adjust the netmask value (255.255.255.0) to your needs.
IMHO this is not possible since the emulator uses a virtual router rather than a physical network interface of your development PC
Have a closer look at this link - there is some detailed information about that
http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With