search

Home  >  Q&A  >  body text

macos - MacBook 上Android Studio 的模拟器无法连接网络

在mac上安装了Android Studio写Android,运行模拟器,发现连不上网络,打开模拟器的浏览器输入www.baidu.com,打不开:

百度了一下,没找到相关答案,请大神帮忙解决一下这个问题。

默认排序 时间排序

6个回答

0

最好的办法是......不用!换Genymotion吧,免费版足以胜任大部分工作

  • 2015年10月30日回答
  • 3 评论
  • 编辑

Akioss658 声望

0

楼上说得对,换Genymotion。

  • 2015年11月11日回答
  • 评论
  • 编辑

阿宝4 声望

0

没遇到过这情况,好像是sdk的问题吧,要加入白名单的

  • 2015年11月11日回答
  • 评论
  • 编辑

海诺1k 声望

0

遇到这种问题可以先排查:
1、是不是公司有代理?那么模拟器也要设置代理,回家后取消代理;
2、是不是手动获取 DNS?或者有备用 DNS ,模拟器用了主 DNS 而电脑用了备用 DNS(模拟器好像只能获取到主 DNS,可能是 sdk 的 bug);
3、可以试试模拟器开关一下飞行模式;
4、其他;

最后
(net::ERR_NAME_NOT_RESOLVED):这个错误是无法解析服务器的 DNS 地址,说明可能是以上第2点。

你评论中说回到公司又可以上网了,那就真的是 DNS 有问题,在家里的时候主机用了备用 DNS。

  • 2015年11月30日回答 · 2015年11月30日更新
  • 5 评论
  • 编辑

Vicent164 声望

0

模拟器无法上网
推荐
Genymotion
海马玩

  • 2015年11月30日回答
  • 1 评论
  • 编辑

Blake632 声望

0

我的有时也连不上网,但是我的只要重新启动下就可以了

  • 2015年12月01日回答
  • 评论
  • 编辑

idisfkj2k 声望

撰写答案

[舍弃]

人参与

相似问题

分享到微博?

Hi,欢迎来到 SegmentFault 技术社区!⊙▽⊙

在这里,你可以提出编程相关的疑惑,关注感兴趣的问题,对认可的回答投赞同票;
大家会帮你解决编程的问题,和你探讨技术更新,为你的回答投上赞同票。

关闭理由: 删除理由: 忽略理由:

高洛峰高洛峰2881 days ago2901

reply all(6)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 15:03:41

    The best way is...no need! Change to Genymotion, the free version is enough for most tasks

    reply
    0
  • PHPz

    PHPz2017-04-17 15:03:41

    The person above is right, switch to Genymotion.

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 15:03:41

    I have never encountered this situation before. It seems to be a problem with the SDK. I need to add it to the whitelist

    reply
    0
  • 迷茫

    迷茫2017-04-17 15:03:41

    If you encounter this kind of problem, you can check first:
    1. Does the company have an agent? Then the simulator also needs to set up a proxy, and cancel the proxy after returning home;
    2. Do you need to obtain DNS manually? Or there is a backup DNS, the simulator uses the primary DNS and the computer uses the backup DNS (the simulator seems to only be able to obtain the primary DNS, it may be a bug in the sdk);
    3. You can try turning the flight mode on and off in the simulator;
    4. Others;

    Finally
    (net::ERR_NAME_NOT_RESOLVED): This error is that the DNS address of the server cannot be resolved, indicating that it may be point 2 above.

    You said in your comment that you can access the Internet again after returning to the company, then there is really a DNS problem. The host uses a backup DNS when you are at home.

    reply
    0
  • PHPz

    PHPz2017-04-17 15:03:41

    The simulator cannot access the Internet
    Recommended
    Genymotion
    海马玩

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:03:41

    My phone sometimes can’t connect to the Internet, but I just need to restart it.

    reply
    0
  • Cancelreply