Solution to the problem that the android simulator cannot access the Internet

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. For those who study Android online at home, the IP addresses of General computers are 192.168.1.100 and not in the same network segment. 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: Start the simulator and ensure that the ADB is connected
Step 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. You can see the following in the result:
 
[Net. dns1]: [10.0.2.3]
[Net. dns2]: [10.0.2.4]
[Net. dns3]: [10.0.2.5]
[Net. dns4]: [10.0.2.6]
 


Step 4: Change DNS to our own DNS
Setprop net. dns1192.168.1.1
 


Note: General TP-LINK and D-LINK DNS are 192.168.1.1, if not please useIpcnofig/allCommand to confirm. In addition, after setting according to the above steps, select "enable data traffic" in the setting-> wireless network settings of the simulator, enable the 3G icon on the toptar of the simulator to access the Internet ~
 

 
In the above method, the property set after the simulator is restarted will be lost, and you need to reset it again. You can use the following method to solve the problem:
 
Find your SDK Directory, which contains a system-images folder. Here you save the system image file and open the build in the text editor. add the net. dns1 = your own DNS. Save it. then create a new simulator ~
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.