Visual Studio Android模拟器没有互联网连接 [英] No internet connection for Visual Studio Android Emulator
问题描述
我正在使用Visual Studio 2015附带的Android模拟器.当我运行它时,在Android的Wi-Fi设置中,对于Wired eth1
网络,此状态显示为Obtaining IP Address..
.但是经过很长时间,它还是失败了.
I'm using Android Emulator that comes with Visual Studio 2015. When I run it, in Wi-Fi settings of Android this status appears Obtaining IP Address..
for Wired eth1
network. But it fails after a long time.
- 在运行模拟器之前,删除了
Hyper-V
的Virtual Switch Manager
中的所有virtual switches
. - 在代理设置中未选中
automatic detect settings
- 尝试了不同的API级别(19,22,..)
- Windows Phone模拟器没有此问题,并且可以连接互联网.
- 重新启动我的PC!
- Removed all the
virtual switches
inVirtual Switch Manager
ofHyper-V
before running the emulator. - Unchecked
automatic detect settings
in proxy settings - Tried different API levels (19,22,..)
- Windows Phone Emulator doesn't have this problem and has internet connection.
- Restarted my PC!
当我诊断vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)
时,它说它具有无效的IP地址.同样在android模拟器中,它尝试获取IP.显然,我需要给仿真器一个有效的IP,但是我不知道如何,在何处或什么值.
When I diagnose vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)
it says it has an invalid IP address. Also inside android emulator it tries to obtain an IP. Obviously I need to give the emulator a valid IP, but I don't know how or where or what value.
如何为Android模拟器提供互联网访问权限? 预先感谢.
How to give the Android emulator internet access? Thanks in advance.
推荐答案
Android似乎无法从DHCP获取IP地址.
It looks like Android is unable to acquire an IP address from DHCP.
在Hyper-V Manager
(virtmgmt.msc
)中,为要尝试启动的仿真器配置文件选择VM,然后转到其Settings...
(右键单击上下文菜单或查看右侧的操作窗格).
In Hyper-V Manager
(virtmgmt.msc
), select the VM for the emulator profile you are trying to start and go to its Settings...
(right click for context menu or see action pane on right side).
在Hardware
下,确保有两个虚拟交换机:
Under Hardware
, make sure there are two virtual switches:
-
Emulator Internal Network Adapter
-
Emulator External Network Adapter
Emulator Internal Network Adapter
Emulator External Network Adapter
Emulator External Network Adapter
必须列为第二个适配器-顺序很重要.如果订购不正确,请删除外部适配器并重新创建,并为其设置与以前相同的设置.您可以通过在VM的硬件列表中单击Add Hardware
来创建它.
Emulator External Network Adapter
must be listed as the second adapter -- the order matters. If they are ordered incorrectly, delete the External adapter and recreate it, giving it the same settings it had before. You can create it by clicking Add Hardware
in the VM's hardware list.
这篇关于Visual Studio Android模拟器没有互联网连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!