The android simulator cannot open the webpage, but can modify the simulator DNS on QQ.

Source: Internet
Author: User

The default address of the android simulator is 10.0.2.3, and the default DNS is 10.0.2.3, which is not in the same network segment as the IP address of the computer. 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 \ Tool

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

ADB Shell

Getprop

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]
Step 4: Change DNS to our own DNS

Setprop net. dns1
192.168.1.1

Note: If you are not sure about DNS, use the ipcnofig/all command to confirm.

These steps are generally used to set up, but I have been tossing for a day and still cannot access the Internet. In the end, I found that my environment was very strange. The simulator's DNS had to be set to a computer's backup DNS, to access the internet! I don't know. It's clear that Windows doesn't use a backup DNS either.

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

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.