Android studio emulator internet connection mac

broken image
broken image

Now launch your emulator with emulator -dns-server 8.8.8.8 command from the terminal which forces the emulator to use 8.8.8.8 as its DNS and the emulator will have internet. So the trick is that you have your google DNS(8.8.8.8) configured in your network settings after your default router settings - this part takes care of downloading the dependencies from jcenter() and the sync and build succeeds.

broken image
broken image

But if i change the DNS in my network settings, the google-services plugin which fetches your dependencies especially the one's getting downloaded from jcenter() will not be downloaded and hence your sync will fail which eventually fails your build. However, ADB root is not working on emulator with Google Play image. adb root adbd cannot run as root in production builds My device was Pixel 2 with the system image of Android 9.0 (Google Play). I used these simple steps to connect the Visual Studio Android Emulator with Android. I had a trouble getting a root access to Android Studio Emulator (AVD), because I couldn't run adb root as following. The problem is when you are connected through the router, the androidwifi in your emulator uses the settings and the sets the DNS to something other than 8.8.8.8 which is the google DNS(I presume this is kinda mandatory setting for the androidwifi to gain internet access). Android emulator not connecting to internet solution on a mac. Answer : I figured the problem with this and fixed it.