How to connect Visual Studio 2015 Android Emulator

2019-01-08 00:43发布

问题:

I've recently installed VS 2015 RC and the Android Emulator seems to work great(it is very fast :)) except it can not connect to network. According to http://blogs.msdn.com/b/visualstudioalm/archive/2015/04/29/visual-studio-emulator-for-android-in-vs2015-rc.aspx the emulator should be able to connect to my WiFi card. I had a look at the emulator in Hyper-V Admin UI and it is configured in the same way as Windows Phone Emulator which works just fine. Any ideas?

回答1:

I had the same problem, when installed RC tools to a PC that had Genymotion previously installed, so what I did was disable the VirtualBox Host-Only Ethernet Adapters (that Genymotion used), and restarted the emulator, then the network on emulator was working



回答2:

First, try disabling any virtual Ethernet adapters that aren't being used (eg. those used by Virtual Box). Next, go to Hyper-V Manager and delete any virtual switches then restart the emulator.



回答3:

Thanks guys for ideas. I uninstalled both Xamarin Android Player and Genymotion and now the VS Emulator works!



回答4:

My environment is a nested virtualization as follows:

Physical machine (WinServer2016) -> VM (WinServer2016) -> VS Emulator for Android

The only thing that worked for me was running the following command in the physical machine:

Set-VMNetworkAdapter -VMName $vmName -MacAddressSpoofing on

Where $vmName is the name of the WinServer2016 VM.



回答5:

for my 5.2" Marshmallow (6.0.0) (android 6.0 - API 23) in VS 2017 after connecting Wifi and answering the question for Connecting the Emulator to network I got my virtual eth2 wifi which is visible as a wifi when you slide down the upper toolbar which you usually see if your networks are connected or not.

but in my previous tries this icon shows an exclamation mark and no internet is shown beside it , after restarting and rerunning the emulator it works

Another useful points is in the network settings which my Hyper-V vEthernet with following name and note that under connectivity it shows internet access with Status of AndroidAPs7 which is name of WiFi connection and my Main Wi-Fi only shows bridged .

  • vEthernet (1x1 11b g n Wireless LAN PCI Express Half Mini Card Adapter Virtual Switch)