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


当前回答

您需要使用“控制面板\所有控制面板项\网络连接”与模拟器共享您的笔记本电脑Internet,并选择笔记本电脑的活动Internet源,然后右键单击然后共享选项卡。在这里勾选共享复选框,如果需要,选择模拟器网络,如果列出。

其他回答

我解决了这个问题,我禁用了所有的网络连接,除了我正在使用的wifi连接,然后将剩余的启用连接的属性设置为静态分配的DNS地址。(没有DHCP)这是Win7 64bit

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!

如果你用的是Mac,试试这个

去苹果图标->系统首选项->网络 点击齿轮图标,选择“设置服务订单” 将活动接口置于其他接口之前。 重新启动Android模拟器。

当我第一次运行模拟器时,我遇到了这个问题,我通过设置dns服务器来解决

Library/Android/sdk/platform-tools/adb shell getprop net.dns1

获取模拟器10.0.2.3的当前DNS服务器

然后设置它到我的局域网dns服务器

Library/Android/sdk/platform-tools/adb shell setprop net.dns1 192.168.1.1

读完这篇文章后,我决定看看我的“网卡”。我把它放在引号里,因为像许多人一样,我正在为Hamachi和virtual Box等设备运行虚拟网卡。在我禁用了Hamachi之后,我可以使用互联网了。我的猜测是模拟器选择第一个可用的nic,而不管它是否是虚拟的。现在来看看我是否可以重新安排我的nic订单而不撕裂我的盒子。

Windows 7 32位