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


当前回答

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

其他回答

(编辑) 对于最新版本的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已经启动,您应该可以使用互联网了。

我认为有时候重启虚拟设备就足够了。: -)

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

我在android 4.4上采取了以下措施: 设置->无线和网络->移动网络 ->确认已开启“数据开启”和“数据漫游”。

如果您在SDK管理器的工具->选项下是代理,则不要配置代理设置。 当你从命令行运行时,添加-http-proxy:

emulator.exe -avd YOUR_AVD_NAME_HERE -http-proxy PROXY:PORT

为我工作。