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


当前回答

检查你是否使用多个互联网连接到你的电脑,比如一个是局域网第二个是调制解调器,所以禁用所有的局域网或调制解调器。

如何设置Android模拟器的Internet选项?

其他回答

我的服务订单首选项是正确的(Wi-Fi是第一个),但仍然无法连接。

答案是,从霹雳桥转弯:

系统参数>网络>霹雳桥

然后将“配置IPv4”设置为“关闭”,并应用您的更改。

不需要在模拟器中摆弄访问点。

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

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

为我工作。

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

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.

是的——在win7中使用管理员privs启动模拟器,一切都会很好——或者至少你会在android中获得无线。