Use adb command in Android to connect mobile phone through IP address

  • 2021-09-20 21:24:46
  • OfStack

Premise: The computer has been connected through USB device cable and the driver has been successfully installed.

There are two ways to connect adb to mobile phone for debugging, one is to use USB line, and the other is to use wireless WiFi.

Type 1 uses USB wire connection

1. Enable USB debugging on your phone

2. Open the DOS command window and enter cd D:\ Android\ sdk\ platform-tools Enter

3. Enter adb devices again, and you can see the device you are connected to.

PS: When you can't see your device, check whether the mobile phone USB debugging is turned on; Whether the mobile phone driver is installed on PC.

Type 2 uses a wireless WiFi connection

First of all, understand one underlying knowledge:

There is a service (adbd) running at the bottom of Android system, which is used to respond to and manage adb command connection on the computer side. When this service is started, it will monitor USB connection or one of the networks according to the configuration of the mobile phone. The configured properties are: service. adb. tcp. port, which is the network port on which to listen

The values of the above attributes > 0: adbd will listen to the corresponding port of the network (1 is generally 5555)
The values of the above attributes < =-1: adbd will listen to USB

The next step is to connect:

Command Line Input: adb connect (ip): 5555

Tip: unable to connect to (ip): 5555

Solution:

1) Connect the phone to PC and execute the following command: adb tcpip 5555

Success Tip: restarting in TCP mode port 5555

Then disconnect USB

Error Prompt: error: device not found

Check whether the mobile phone USB debugging is turned on; Whether the PC terminal is equipped with a mobile phone driver.

2) Then execute adb connect (ip): 5555, and the connection should be successful

Success Tip: connected to (ip): 5555

After debugging, enter the following command to disconnect:

adb disconnect (ip):5555

Summarize

The above is the site introduced to you Android using adb command through IP address to connect mobile phones, I hope to help you, if you have any questions welcome to leave me a message, this site will reply to you in time!


Related articles: