如何将我的Android模拟器连接到互联网,例如使用浏览器?我已经找到了很多关于如何通过代理连接的建议,但这里不是这样,我的机器(Windows 7)是直接连接到路由器的。


当前回答

我在Win7 64位上遇到了类似的问题。尝试禁用我的hamachi和virtualbox适配器,但没有工作。尝试以管理员身份启动avd,但没有工作。最后,我使用这个网站上的信息禁用了teredo隧道适配器,它工作了: http://www.mydigitallife.info/2007/09/09/how-to-disable-tcpipv6-teredo-tunneling-in-vista/

其他回答

I think some of the answers may have addressed this, however obliquely, but here's what worked for me. Assuming your problem is occurring when you're on a wireless network and you have a LAN card installed, the issue is that the emulator tries to obtain its DNS settings from that LAN card. Not a problem when you're connected via that LAN, but utterly useless if you're on a wireless connection. I noticed this when I was on my laptop. So, how to fix? Simple: Disable your LAN card. Really. Just go to your Network connections, find your LAN card, right click it and choose disable. Now try your emulator. If you're like me, it suddenly ... works!

我在Win7 64位上遇到了类似的问题。尝试禁用我的hamachi和virtualbox适配器,但没有工作。尝试以管理员身份启动avd,但没有工作。最后,我使用这个网站上的信息禁用了teredo隧道适配器,它工作了: http://www.mydigitallife.info/2007/09/09/how-to-disable-tcpipv6-teredo-tunneling-in-vista/

(编辑) 对于最新版本的Android Studio,你需要使用的模拟器不再在~/Library/Android/sdk/tools文件夹中,而是在~/LibraryAndroid/sdk/emulator中。 如果在尝试下面的解决方案时,您会得到以下消息“PANIC:缺少'x86' CPU的模拟器引擎程序。,然后请参考https://stackoverflow.com/a/49511666更新您的bash环境。

操作系统:Mac OS X El Capitan

IDE: Android Studio 2.2

由于某些原因,我无法通过工作时的AVD访问互联网(可能是代理或网络配置问题)。 对我来说,诀窍是在命令行启动我的AVD,并手动提供谷歌公共DNS 8.8.8.8。

在你的终端中,进入Android sdk的文件夹工具,找到“模拟器”程序:

cd ~/Library/Android/sdk/tools

然后检索avd的名称:

emulator -list-avds

它会返回如下内容:

Android_Wear_Round_API_23
Nexus_10_API_22
Nexus_5X_API_22
Nexus_5X_API_24
Nexus_9_API_24

然后按以下指示启动您想要的AVD:

emulator -avd NameOfYourDevice -dns-server 8.8.8.8

您的AVD已经启动,您应该可以使用互联网了。

我在虚拟windows 7上也遇到了同样的问题。

转到网络连接 Alt >高级>高级设置… 在第二个选项卡将互联网网络界面放在顶部

希望对大家有帮助 多亏了

it appears there might be a few reasons why there might be no internet connection for an emulator, in my case i was working from home where i have a wireless connection then came into the office and plugged in direct, however although my wireless connection was disconnected it was not disabled resulting in no emulator connection. my understanding is that when it starts up it looks for a network adapter and if there is any conflict here it might result in no internet connection. to resolve go to Start > Settings > Network Connections right click on Wireless Network Connection (if you are not using wireless) and select disable