Two ways ADB connects to a phone

Source: Internet
Author: User

The ADB connects to the phone for debugging in two ways, one using a USB cable and one using wireless WiFi.

First connection using USB cable

1. Enable USB debugging on the phone

2. cmd window input adb devices, you can see your own device at this time.

PS: When you cannot see your device, check whether USB debugging on your phone is turned on, or if you have a mobile phone driver installed on your PC.

The second use of wireless WiFi connection

First, learn a little bit about the underlying knowledge:

The Android system is running a service (ADBD), which responds to and manages the ADB command connection on the computer side, which listens to one of the USB connections or networks at startup based on the configuration of the phone. The configured properties are: Service.adb.tcp.port, which is the listening network port

    • The value of the above attribute > 0:adbd will listen to the network corresponding port (typically 5555)
    • The value of the above attribute <=-1:ADBD will listen for USB

Next is the connection step:

1. Command-line input: ADB connect 172.16.4.37:5555 (: 5555 can be omitted)

Tip: Unable to connect to 172.16.4.37:5555

Workaround:

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

Success prompt: Restarting in TCP mode port 5555

If the phone is not connected to the PC, direct use of the above command will prompt Error:device not found

Then disconnect the USB

2) then execute the ADB connect 172.16.4.37:5555, this time should be able to connect successfully

Success Tip: Connected to 172.16.4.37:5555

2. Enter the ADB devices and get the following tips to show that the connection is successful and can be debugged.

List of devices attached

172.16.4.37:5555 devices

3. After debugging is complete, enter the following command to disconnect:

ADB disconnect 192.168.1.5:5555

4. The last step, you need to reset the listening network port to 1, listen to the USB port (as if not to do this step, directly plug in the USB cable can also be used normally, and this step often prompts could not the Set property, need root permission)

SetProp service.adb.tcp.port-1

Stop ADBD

Start ADBD

Two ways ADB connects to a phone

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.