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


当前回答

就我而言,我只需要从“Android SDK和AVD管理器”中启动Android虚拟设备(AVD),它就可以工作了

其他回答

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

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

当我第一次运行模拟器时,我遇到了这个问题,我通过设置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

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.

我也遇到过同样的问题。 我找到的最简单的解决方法是:

转到Android\Sdk\emulator文件夹,打开命令提示符。 输入emulator -list-avds查看可用的模拟器名称。 输入模拟器-avd name-of-your-device -netdelay none -netspeed full -dns-server 8.8.8.8命令,按“enter”。