没有Internet连接的Visual Studio Xamarin和Android模拟器 [英] Visual Studio Xamarin and Android emulator without internet connection
问题描述
我正在使用Visual Studio 2015开发Xamarin项目.
I'm developing a Xamarin project using Visual Studio 2015.
问题是我无法使用Internet从Visual Studio启动Android模拟器.我在代理后面.
The issue is that I'm not able to start the Android Emulator from Visual Studio using Internet. I'm behind a proxy.
使用HttpWebRequest
,出现错误:
System.Net.WebException:错误:ConnectFailure(网络为 无法访问)
System.Net.WebException: Error: ConnectFailure (Network is unreachable)
我检出仿真器,但未检测到Internet连接:
I check out the emulator and no Internet connection detected:
我能够使用命令行(使用emulator.exe -avd avdName -dns-server 192.168.1.1
)启动模拟器来设置代理/dns,但无法从Visual Studio中启动.
I was able to start the emulator setting the proxy/dns using command line (using emulator.exe -avd avdName -dns-server 192.168.1.1
), but not from Visual Studio.
我的问题是:是否可以通过Visual Studio或任何配置文件(例如.ini或Avd文件夹中的config.ini)或其他方式将Proxy/dns配置设置为Android仿真器?
My question is: is there any way to set proxy/dns configuration to Android Emulator from Visual Studio or in any configuration file, like .ini, or config.ini in Avd folder, or any other way?
推荐答案
从那时起,我很确定您已经解决了您的问题,但是我遇到了同样的问题,并找到了以下解决方案:
I'm pretty sure you resolved your problem since then, but I faced the same one and found the following solution :
在首选项/项目/Android"中,只需在其他仿真器启动参数"中设置-dns-server 8.8.8.8
(尽管不确定其英语翻译方式).
In Preferences / Projects / Android, just set -dns-server 8.8.8.8
in "additional emulator launch arguments" (not sure of how it translate in english though).
Xamarin Visual Studio社区偏好设置(屏幕截图)
这篇关于没有Internet连接的Visual Studio Xamarin和Android模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!