Internet stopped working on Android Emulator (Mac OS)

后端 未结 9 1501
梦谈多话
梦谈多话 2020-12-08 01:57

I am using Android Studio 2.3(Latest). Till yesterday it was all good and working, today emulator is not connecting to the data network.
I couldn\'t find any solution wo

相关标签:
9条回答
  • 2020-12-08 02:40

    There was an update available to my Android Studio, i updated it and it worked!

    0 讨论(0)
  • 2020-12-08 02:42

    For me the issue appears to stem from the DNS settings my company enforces.

    In order to be able to get network access for my emulator I needed to launch the emulator with the same corporate dns-server specified.

    I'm on a Mac, so first I checked my network settings to find what my DNS was set to:

    System Preferences -> Network -> Wi-Fi -> Advanced -> DNS
    

    Then navigated to the sdk emulator location (for convenience):

    cd ~/Library/Android/sdk/emulator
    

    Then listed the available emulators:

    ./emulator -list-avds
    

    Then ran the desired emulator with dns server override:

    ./emulator @<emulator_name> -dns-server <dns.server.ip.address>
    

    It would be nice if I could set this DNS to be used by emulators launched through Android Studio, but hopefully these steps help someone else in a similar position.

    0 讨论(0)
  • Couldn't find any solution by tweaking network settings. So added a new virtual device from Tools -> Android ->AVD Manager by downloading a new system image(Android O, API 26). And it's working now.

    If you want to use the same API level then make sure to delete the existing system image and download it again.

    0 讨论(0)
提交回复
热议问题