See some onlineProgramThe writing is very complicated, and basically requires root. For licensed machines, the root may lose the warranty.
Therefore, do not use root as much as possible.
If you have root, you can select adbwireless, which is very convenient. click the button to prepare the machine.
If it is not root, make sure that your computer and mobile phone are connected to WiFi and in the same LAN.
1. Connect the USB to the computer.
2. Run the SDK directory platform-Tools
ADB TCPIP5555
Switch the ADB on the machine to the network mode. The latter 5555 is the port number. I want to change it to another one, but it is not necessary.
3. Find the IP address of your machine and execute
ADB connect<Your mobile IP Address>:5555
In this way, the phone is connected through WiFi.
You can run the ADB command or debug it through eclipse.
4. switch back to USB Mode
ADB USB