网站更新内容:请访问: https://bigdata.ministep.cn/

flutter AndroidStudio 模拟器无网络连接

Error: SocketException: Failed host lookup: '' (OS Error: No address associated with hostname, errno = 7)

 

命令启动模拟器

1.找到你的模拟器名字,默认在C:\users\xx\.android\avd目录下,如图3-3。如果找不到可以在Android Studio->AVD Manager->show on disk定位到此目录如图3-4

​​​​图3-3​​​

 

图3-4​

 2.找到SDK的emulator目录,目录如图3-5

图3-5

3.在dos命令窗口切换到SDK的emulator目录下运行命令,模拟器名字要对应上自己的模拟器名字,我的模拟器名字是Pixel_API_29

emulator -avd Pixel_API_29 -dns-server 8.8.8.8,114.114.114.114

 回车之后,系统会帮你启动你电脑中名叫Pixel_API_29的模拟器,此时模拟器便可以上网了。这种方式最简单粗暴,但也最麻烦,因为这只是一次性的,如果下次不输入这行命令,模拟器还是不能上网,所以每次启动前都要输入这行命令。

## 参考

[解决AndroidStudio 模拟器无网络连接 - 大飞_dafei - 博客园](https://www.cnblogs.com/dafei4/p/17861767.html)

[(转)解决Android Studio模拟器无法联网_androidstudio模拟器无法联网-CSDN博客](https://blog.csdn.net/zyb418/article/details/123738818)

 
posted @ 2024-06-15 23:09  ministep88  阅读(16)  评论(1编辑  收藏  举报
网站更新内容:请访问:https://bigdata.ministep.cn/