Not able to connect to Internet from Visual Studio Emulator for Android

后端 未结 7 819
故里飘歌
故里飘歌 2020-12-17 17:24

I just installed VS 2015 RC and opened up the VS emulator for Android. I am not able to connect to internet from this emulator. I went to settings -> WiFi and could see its

7条回答
  •  甜味超标
    2020-12-17 17:50

    Put away your shotguns folks. The key to solving this is a complete understanding of the problem. The VS Android Emulator is not configured out of the box with an external network connection. (Why? Why? Why?). The only network adaptor it has (Window Phone Emulator Internal Switch) is (as it name says) internal, that is not connected to the internet. It is only used (apparently) for communicating with the host.

    So to have internet connection we need to add another virtual adaptor and connect it on the host system to the internet.

    See this blog post to add and configure adaptor: http://blog.tpcware.com/2017/03/visual-studio-2017-android-emulation/

    Overview:

    1. In Hyper-V Manager add a new Virtual Switch. Name it External. See that it is connected to your real network connection.
    2. In the virtual machine settings for the Android emulator, add a new network adaptor (emulator must be stopped to do this). Select the newly created external virtual switch.
    3. Start emulator and open browser. Voila! You now have internet access.

    So please disregard all the advice about rebooting, repairing, re-installing, etc. This is all a complete waste of time. I am astonished that some folks report this fixes the internet connectivity.

    One last thing. The blog post says that this approach does not work if you network adapter is wireless. It works find for me and I only have a wireless connection from my laptop.

提交回复
热议问题