Simulator cannot access the Internet solution

Source: Internet
Author: User

The first method is to set up a proxy (if your computer uses a proxy to access the Internet and the simulator cannot be connected to the Internet, use this method ):

Start the simulator and go to Settings> wireless controls> mobile networks> Access Point names:



Click to enter and set it as follows:

-Proxy: your proxy address
-Port: your proxy port number

If it is other errors, you can take a look at the http://blog.csdn.net/gushukuan/article/details/5604197 this blog, my correction is also used in the method.

Method 2: Modify the DNS of the simulator

The default address of the android simulator is 10.0.2.3, and the default DNS is 10.0.2.3. For people who study Android online at home, the IP addresses of General computers are 192.168.1.100, but if they are in the company, the situation is different, and may be different from the same CIDR block. Therefore, the computer can access the Internet, but the simulator cannot access the Internet. In fact, it is easy to set the default DNS of the simulator to the DNS address of the computer.

Step 1: Use System commands to enter the android Development Kit tools directory

Cd x: \... \ Android-SDK-Windows \ tools (2.3)

In 2.2, X: \... \ Android-SDK-Windows \ platform-Tools

Article 2: Use the shell of ADB to confirm the attributes of the system.

adb shellgetprop

Getprop lists the current attributes of the system.

Step 3: Obtain the DNS address of the simulator.

In the result, we can see:

[net.dns1]: [10.0.2.3][net.dns2]: [10.0.2.4][net.dns3]: [10.0.2.5][net.dns4]: [10.0.2.6]

Or similar statements.

Step 4: Change DNS to our own DNS

setprop net.dns1 192.168.1.1

Note: General TP-LINK and D-LINK DNS are 192.168.1.1, if not please use ipcnofig/all command to confirm.

If you use the browser of the simulator again, you will find that you can access the Internet.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.