Android adb wifi debugging

Android adb wifi debugging

0. You need to configure the environment variables of adb first. Open the environment variable setting of the computer, add the path of Path, and enter this location under the sdk (D:\androidsdk\platform-tools). If you can use the adb command on windows, but it doesn’t work in Android Studio, it won’t work even if you restart as In this case, you have to restart the computer (adb can be used in cmd, but not in terminal, two words: restart the computer) to configure environment variables

1. The mobile phone and the computer are connected to the same LAN (together with a WiFi) (this is very important! this is very important! this is very important!)

2. Check the IP address of the mobile phone under the connected WiFi in the settings and network connections of the mobile phone

Basic process: Settings--WLAN--connected wifi--find the IP address. Some phones may be different

3. Connect the mobile phone to the computer, and enter the command: adb tcpip <port number>, <port number> can be taken arbitrarily, as long as it is not occupied, such as 6666, here basically use 5555

4. Unplug the data cable and enter the command: adb connect <mobile phone IP address>:<port number>, output connected to <mobile phone IP address> means the connection is successful, enter as follows: adb connect 10.3.1.118:5555,10.3.1.118 Yes Mobile IP address

5. You can view the connected devices, command: adb devices

If the status of the device here is unauthorized, then the proof is not working.

5.1. Check whether the adb_usb.ini file exists in C:\Users\Administrator.android

If you don't need to recreate one yourself, enter the following

add your vendor IDs, one per line

0xxxxx

this is the phone id

5.2. Authorization problem, if the authorization dialog box can pop up, choose to always allow this computer to use

6. It can be debugged normally. Run the app or watch the Log, which is the same as connecting the data line, and it is not limited by the line.

7. Disconnect, command: adb disconnect <mobile phone IP address>:<port number>, such as: adb disconnect 10.3.1.128:6666

8. When the connection can be debugged, new problems may appear

The problem of installation timeout may be that the wireless debugging port is not opened

9. Open the wireless debugging port

Some Android devices close the wireless adb debugging port by default, so when connecting to adb wirelessly, errors such as host positive rejection or connection timeout will occur. At this time, you need to execute the following command on the Android device in advance

adb shell setprop service.adb.tcp.port 5555

adb shell stop adbd

adb shell start adbd

You can connect to the computer adb in advance to execute this command, or you can use the Android terminal to execute this command after rooting

10、Waiting for all target devices to come online

This problem is also connected and debugged by wifi. It can be installed normally after plugging in usb, mainly in step 9.

11. Problems with Huawei mobile phones

It can be connected using adb connect, but once the usb is unplugged, there will be a problem of not being able to connect (offline or other).

The specific problem is:  Developer Options - Debugging - USB Debugging will be forcibly turned off

The solution is: Allow ADB debugging in "charge only" mode  This option needs to be turned on

Enable ADB on Huawei mobile phones for WIFI remote debugging

Precautions:

  • The phone needs to enable USB debugging

  • The mobile phone and the computer must be on the same LAN (connect to the same WiFi)

  • After adb connect is successfully connected, the USB cable must be pulled out, otherwise there will be a problem of connecting two devices at the same time

  • You may need to re-enable USB debugging after executing the command "adb tcpip 6666"

reference:

Android wireless debugging phone (WiFi debugging)

Android Studio uses WIFI to debug adb wirelessly (3 methods)

question:

Android wifi adb debugging, [Android] wireless adb debugging has been solved

"Waiting for all target devices to come online" not resolved when running android app over tcp

Guess you like

Origin blog.csdn.net/fromVillageCoolBoy/article/details/130264142