Android adb remote debugging

adb remote debugging can remotely package and print out the log of the device in real time, no longer need to be restricted by the data line. The main steps of adb remote debugging are divided into eight parts, as follows:

Turn off firewall

Because the firewall refuses the link, the adb service cannot be started, so you need to turn off the firewall of the LAN.

Configure ADB environment

Similar to the JDK configuration environment, the SDK tools and platform-tools directories are added under the environment variable path, as shown in the following example:
ADB environment configuration
Some on the Internet also use the created variable android to reference. I personally think it is unnecessary. It is clearer to directly configure the address.

Start ADB service

Open cmd and enter adb server:
Start adb service
similar to the above picture, there is no prompt after entering enter, which means the startup is successful

Check the IP of the device in the LAN

Turn on the mobile device and find the IP address under the local area network. The location of each mobile phone to view the IP is different. It should be noted that the computer and the mobile device must be under the same local area network, otherwise everything is meaningless. The following take 192.168.31.162 as an example

Data line link equipment

Use the data cable to link the computer and the mobile device, and view the device: adb devices
View device

Set port

Enter adb tcpip 5555 in the cdm, which means that the adb service will requisition the 5555 port of the computer, and this port must be ensured that it is not occupied by other programs
Insert picture description here

Connect the device

Insert picture description here

Download the plugin for ADB WIFI

Search for ADB WIFI under the file-setting-plugin of Android Studio and restart it. At this time, Android Studio can debug the mobile device just connected in cmd even if there is no data cable connection.

Guess you like

Origin blog.csdn.net/lilifang_2011/article/details/112940539