1
votes

In the stock Android emulator, 10.0.2.2 always maps to the host. This makes it handy for baking into web service tests on the device. Is there any equivalent host name or address for the Visual Studio Emulator for Android or a way to create one?

Hyper-V creates a "Internal Ethernet Port Windows Phone Emulator Internal Switch" with address 169.254.80.80, but the emulator can't access it.

1

1 Answers

0
votes

there is no such builtin address I believe, but you can do something similar:

create internal LAN switch in hyper-v and link it to some of your network cards (wifi or ethernet) via internet connection sharing (ICS).

in this case host adapter attached to this internal switch will get fixed address (192.168.137.1) and some kind of dhcp server serving 192.168.137.0/24 subnet.

attach this switch to android image in hyper-v and emulator will get address 192.168.137.abc, will be able to connect to host on 192.168.137.1 and have access to internet at the same time