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


当前回答

在Android模拟器中,打开飞机模式,然后再关闭,对我来说很管用。

其他回答

我在Web浏览器中没有网络连接,安装Android SDK (Replicant开源版本)后使用WLAN,与禁用LAN卡或DNS服务器不使用DHCP无关。我的问题是:设置->无线和网络->移动网络->“数据启用”没有被选中。这是所有。

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

I have Mac OS X 10.7.2, Eclipse Helios Service Release 2. I also work via Proxy and my IP settings are via DHCP. I solved this issue firstly using this article http://www.gitshah.com/2011/02/android-fixing-no-internet-connection.html, then I removed Emulator settings and just go to Run->Run Configurations->Target->Additional Emulator Command Line Options and type there -http-proxy xxx.xx.111.1:3128 . Also I would like to say that when I typed also a DNS like this: -dns-server xxx.xx.111.1 -http-proxy xxx.xx.111.1:3128 it did not work, but when I removed DNS it worked. Also I would like to note, that Additional Emulator Command Line Options are not visible without scrolling to the bottom of that window. I also want to note, that when you change emulator options, all apps will work. But If you write Additional Emulator Command Line Options, you need to write them every time for every app target in Run Configurations.

环境: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 XP电脑,有WIFI连接,没有代理。我有诺顿网络安全运行在我的机器上,它有一个智能防火墙。这个智能防火墙管理程序对网络的访问,包括模拟器.exe。我进入设置->程序控制,然后授予模拟器.exe的完全访问权限。在这之后,我开始Android模拟器和bang…我可以上网。

希望这能对新人有所帮助。

~下垂的