Android emulator not able to access the internet
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
When an Android emulator cannot reach the internet, the problem is usually one of four things: the host machine has a network or VPN issue, the emulator is misconfigured, DNS resolution is failing, or the app is trying to reach the wrong address. The fastest way to fix it is to separate those cases instead of changing random settings inside Android Studio.
Start by Confirming What Is Actually Broken
There is a big difference between:
- the emulator cannot reach any public site
- the emulator can browse the web but your app cannot hit an API
- the emulator can reach the internet but cannot reach your local machine
Test from inside the emulator first. Open the browser and try a public site. If you want a shell check, use adb:
If 8.8.8.8 works but google.com fails, the network path is fine and DNS is the problem. If both fail, the emulator or host network is blocked more broadly.
Remember That localhost Is Not Your Computer
This is one of the most common emulator networking mistakes. Inside the Android emulator:
localhostmeans the emulator itself10.0.2.2means the host machine running the emulator
So if your app is calling a backend on your laptop and the code uses http://localhost:8080, it will fail from the emulator even though the internet works.
Use:
instead.
That is not an internet outage. It is just the wrong address.
Check the Host Machine Before Tuning the Emulator
The emulator uses the host network stack. If the host machine is offline, behind a restrictive firewall, or trapped behind a VPN that blocks virtual interfaces, the emulator inherits the problem.
Common host-side causes are:
- corporate VPN software filtering local virtual adapters
- firewall or antivirus blocking
adbor emulator traffic - DNS issues on the host machine itself
- hotel, campus, or captive-portal Wi-Fi that the emulator has not effectively inherited
If the host browser cannot reach the internet reliably, fix that first. If the host works but the emulator does not, temporarily disable VPN or firewall filtering and retest.
Reset the Emulator Networking State
Emulators do get into bad network states. A cold boot is often enough.
Try these in order:
- close the emulator
- in Device Manager, choose
Cold Boot Now - if that fails, choose
Wipe Data - restart
adb
If you use snapshots, a bad saved state can preserve broken networking across launches. A cold boot clears that kind of stale state much more reliably than just reopening the window.
Fix Proxy and DNS Problems Explicitly
If your machine uses a proxy, the emulator may need the same proxy. You can configure that in Android Studio or with adb.
To clear it later:
For DNS issues, inspect what Android sees:
If DNS is consistently broken, launching the emulator with explicit DNS servers can help. The emulator also tends to behave better once the host DNS issue is fixed, because it is usually inheriting from the host rather than inventing its own resolver setup.
Check App-Level Requirements Too
Sometimes the emulator has internet, but the app still fails because of Android networking policy.
Examples:
- cleartext HTTP is blocked on newer Android versions unless allowed
- the app has a bad base URL for debug builds
- certificate or TLS failures are being mistaken for connectivity failures
If your requests are plain HTTP, review the network security config or switch to HTTPS. If only one API call fails while Chrome works inside the emulator, the problem is probably in app configuration rather than emulator networking.
Common Pitfalls
- Using
localhostinstead of10.0.2.2for services running on the host machine. - Treating DNS failure as total internet failure.
- Editing random files inside the emulator instead of checking host networking first.
- Forgetting that VPN and firewall software on the host can block emulator traffic.
- Assuming the emulator is offline when the real problem is Android cleartext or TLS policy.
- Reusing a bad snapshot state instead of cold-booting the device.
Summary
- First decide whether the problem is internet access, DNS, or access to a local backend.
- Use
10.0.2.2to reach services on the host machine from the emulator. - Check the host network, VPN, and firewall before changing emulator settings.
- Cold boot the emulator and restart
adbwhen the virtual network state looks stale. - Fix proxy, DNS, or app-level network policy only after you know which layer is failing.

