Recently, while developing an Android Application, I was faced with a situation that wasted 2 hours of my time. The issue was simple, my app was not able to access internet from the Android Emulator.
@Yksh.Leo - I had tried that route initially but it had no effect. I would expect switching over to a bridged adapter would have a similar 'narrowing' effect on the nic used by the emulator. FYI - I am using Virtualbox 5x and the latest Android Player as of today's date. Android - Fixing the no internet connection issue on emulator Recently, while developing an Android Application, I was faced with a situation that wasted 2 hours of my time. The issue was simple, my app was not able to access internet from the Android Emulator. Android Studio’s emulator is the default Android console which comes with a bunch of additional tools. The tools are quite useful for the developer to test the Android app and games. As the name suggests it’s an Emulator to run Android apps on PC as well. This tool is available for Windows 7/8/10.
Initially I thought fixing the issue should have been straight forward, but life is not always that simple.
So what was the real issue because of which my app was not able to access internet? There are multiple reasons because of which this issue could occur. Hence, I decided to document my findings so that other could benefit from it.
There are two main symptoms of no internet connection on android emulator
- Only your app is not able to access the internet
- None of the apps are able to access the internet

A sample AndroidManifest.xml file with the added permission would look like
Compile and re-install the app in the emulator and try to access the internet from your app. It should work!
What is the use of uses-permissiontag:
Android application can request certain permissions so that they can function properly. Some examples of permissions are, get users location, make a call, access the internet etc. App has to explicitly specify this in the AndroidManifest.xml.
When end users install such an app on their device, the android OS will notify the user that, app is requesting certain permissions. If users are fine with that, then only the app will be installed. Else users can deny the permission and the app will not be installed.
- Proxy server is not configured on the emulator
- Incorrect DNS used by the emulator
:max_bytes(150000):strip_icc()/Screenshot2019-10-15at15.47.27-2e634da21e2f4e639194b89d7cad01de.png)
Settings |
Wireless and Networks |
Mobile Networks |
Emulator For Mac
Access Point Names |
Select the access point |
Set the proxy and port values |
Android Emulator For Mac Air
-dns-server takes a comma separated list of IP address to use as DNS server.
That did the trick for me! I was finally able to access internet from my app on the android emulator!
Normally I'm developing on a mac with Xamarin Studio. Debugging an Android project on the Android emulator running on your mac is easy, because it just works. But now and the I need to do some work from my windows machine. My windows is running as a VM with Parallels Desktop.
Visual Studio isn't recognising the Android emulator running on my mac. I'm ok with that because the mac and windows are two different machines. Now, there is a way to debug your Android app on the emulator running on mac from your visual studio running on windows (if you don't lost me now, keep reading because doing so isn't that hard).
Find the IP address of your mac
Open up a terminal application and search for your ip address:
Connect the emulator from Windows
Normally it should be possible to connect to an emulator via the adb command.
On your windows machine open up an Android Adb Command Prompt and try to connect with the command:
I was a bit surprised to see the following error:
Even with the firewall on the mac disabled I got the same result. After some googling I wasn't surprised to find a solution on the Xamarin website itself. The full article can be found on https://developer.xamarin.com/guides/android/troubleshooting/questions/connect-android-emulator-mac-windows/
To make it easy, I'll give you the short version:
Step 1
Kill the adb server on your mac
Step 2
forward inbound TCP packets to the loopback interface and outbound packages back the other way
That's it, as long as you leave that command open, you can now connect from your Windows machine to your Android emulator running on the mac. And when the firewall of your mac is enabled you'll get a pop-up to ask if it's ok to change its settings.
