adb connects phone via WiFi

Prerequisite: the phone and computer are connected to the same wifi
1. Set the port number.
First, connect the phone to the computer via USB and set the port number for the phone:

adb tcpip 6666

The following prompt appears, indicating that the setting is successful:

restarting in TCP mode port: 6666

2. Connect to the mobile phone
adb connect mobile phone ip: port, for example:

adb connect 192.168.51.242:6666

The following prompt appears, indicating that the connection is successful:

connected to 192.168.51.242:6666
  • The port is the port set in step 1
  • The mobile phone IP can be determined through adb shell, then execute ifconfig in the shell, and then view the corresponding IP
    Insert image description here

3.Verification

adb devices

The following prompt appears, indicating that the mobile phone has been connected

List of devices attached
192.168.51.242:6666     device

Guess you like

Origin blog.csdn.net/fengyulinde/article/details/107228846
Recommended