Android Emulator won’t connect to internet

Many a time I see this problem where the Android emulator simply refuses to connect to internet. There are 2 easy solutions to fix this problem.

1. The primary reason is that your machine might have both LAN and Wireless enabled and the internet connection is available only on Wireless. Since the emulator always tries LAN to for DNS settings it will be unable to connect. To fix this problem

  • Right click on your “My Network Places” and select properties
  • Select your LAN connection and disable it.
  • Restart your emulator

2. If the above solution doesn’t work then try launching your emulator with the following command prompt.

emulator -avd <avd name> -verbose -dns-server 8.8.8.8

or if you are using eclipse to start the emulator then

    • Right click on your project and select “debug as”
    • Select “debug configuration” and select “target” tab
    • Enter the following text in the text field below “Additional Emulator Command Line Options”

      -dns-server 8.8.8.8

Emulator Configuration

  • The above steps applies to “Run Configuration” as well.
4519 Total Views 4 Views Today