Turn: Android Simulator connects to computer network

Source: Internet
Author: User

Original address: http://www.it165.net/pro/html/201212/4444.html

The first step:

Entering the ADB shell command at the command line (that is, start-run-input cmd) typically reports two errors, one is "ADB is not an internal command or external command, is not a running program or batch file," and the second is "Error:device not found".

For the first type of error, the environment variable is not configured. The so-called environment variables, which are the information used by each application, are mostly not configured with the path path, which is where the. exe and. BAT programs execute. Because the computer will look for the Adb.exe program in the current directory (typically C:\User\Administrator) at the command line, and if it is not found, it will be searched through the path in the environment variable (in English format; If there are no Adb.exe programs under each path in path, it is reported that "ADB is not an internal command or external command, or a program or batch file that can be run" error. There are two workarounds: one is to add the Adb.exe path to the path path, Adb.exe in the SDK directory under Platform-tools, such as my Android SDK file is located under D:\Android, the correct path path should be "D : \android\android-sdk-windows\platform-tools ". Append this string of characters to the system or user environment variable under path, and the second is to enter the Patform-tools directory in a DOS environment, taking my machine for example, using "CD D:\Android\android-sdk-windows\ Platform-tools "command into the Platform-tools directory, and then use" dir "(under Windows) can see the list of Adb.exe files, then execute the" adb shell "command is OK.

For the second type of error, the Android virtual machine is not turned on. Because the ADB shell command actually operates on the current virtual machine, it needs to go into the file structure of the current virtual machine. If the virtual machine is not turned on, this command will of course report the error "Error:device not Found" (that is, no device found). The workaround is to open the virtual machine and ensure that the first error has been resolved, and enter the ADB shell to enter the structure of the Android virtual machine normally.


I made the second mistake, didn't open the Android virtual machine


Step Two:

Set DNS Address

First, you need to get your DNS address.

First, how to view their IP address and DNS

1, first in the bottom left corner of the screen "start"


2. Select [Run] and enter CMD in the blank space.


3. Click [OK] after entering cmd, then enter Ipconfig/all


4, in the hit Enter, will show you the local connection IP address, gateway, DNS


At this point, we can see the internal IP, gateway and DNS used to query the domain name.

If you enter a prompt that indicates that the command is not an internal or external command, you cannot run the executable file and or batch file.
Then you should do this:

The third step: the author through the "My Computer → properties → advanced" tab of the "Environment variables" button to view the relevant information. found that the path entry value in system variables is empty (not necessarily empty, possibly other, the main problem is that the system path is less), which should be the key to the issue, because the default path is empty, so a command system such as Ipconfig will not be able to find the program if it is running under any path. Www.it165.net

Fourth step: Double-click the path parameter for its settings (do not have to delete the original, you can add more, see the following hint) variable value "C:\Windows\System32".
(Tip: If you want to set multiple default paths you can use a form like c:windowssystem32;c:windows, which is the middle ";" Separated. I have already had two paths in that, pay attention to separated by the English semicolon.

Fifth step: Confirm and then enter "ipconfig" in the command line mode to display the correct information.


Now is the final step:

Set up DNS:


CMD window, enter the ADB shell, such as:

C:\Documents and settings\administrator>adb Shell

will appear # _ (prompting you to enter)
Then enter: Getprop View the current properties of the system, get the DNS address of the emulator, as follows:

[NET.DNS1]: [10.0.2.3]

The following is the use of the SetProp command to change the emulator's DNS to the DNS of its own PC, for example:

Input SetProp net.dns1 192.168.0.185

will automatically eject:
SetProp net.dns1 192.168.0.185


Do not close the command window at this time (the DNS is restored after the shutdown), click on your emulator browser, you can see the normal Web browsing!

Turn: Android Simulator connects to computer network

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.