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


当前回答

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!

其他回答

在eclipse中转到DDMS

在DDMS下选择模拟器控制,其中包含电话状态 在电话状态包含数据——>选择Home,这将启用您的互联网连接,如果您想禁用模拟器的互联网连接,那么——>选择None

(注意:只有当运行eclipse的PC/笔记本电脑有活跃的internet连接时,才会启用internet连接。)

环境:Windows 7 64位

在我的例子中,我必须在verbose模式下运行模拟器(emulator -verbose -avd Nexus_6_API_25)来找出模拟器检测到两个DNS服务器的事实,如下所示。

模拟器:找到2个DNS服务器:192.168.3.227 192.168.1.1

在检测到的两个DNS服务器中,只有一个有互联网连接,这是模拟器无法上网的原因。

为了成功连接android模拟器到互联网,没有互联网连接的DNS服务器必须从控制面板\网络和互联网\网络连接中禁用

我有一台windows 7(64位)的机器,我的模拟器不能工作。在四处寻找之后,我最终静态地将我的路由器添加到网络DNS属性(192.168.1.1)。它开始起作用了。

右键单击Eclipse中的Project select Run As -> Run Configurations… 选择Android应用程序,然后选择“目标”标签 寻找“附加模拟器命令行选项”并将此命令行放入文本框 -http-proxy http://< username >:< password >@< hostname >:< port > .使用实例

我没有使用代理……然而,我正在使用一个脚本…在这附近。我在公司的防火墙后面