When developing an Android app, it's usually connected to the device and computer via a USB cable, but for some applications that need to use a USB device, this approach is troublesome, and the USB port of the phone is connected to the external USB device and no longer connected to the data cable. This can be done by means of a network TCPIP. That is, ADB connects devices over the network without the need for a USB cable.
Here's how:
1. Connect the device using the USB cable.
2. Open cmd into the Sdk\platform-tools directory (mine is E:\adt-bundle-windows-x86-20140702\sdk\platform-tools), enter ADB tcpip on the command line 5555 ( 5555 is the default port number, can be specified freely)
3. Disconnect the USB data so that you can connect to the phone device you need to connect to.
4. Enter the IP address >:< port number of the ADB connect < device again at the command line, the device address can be found from the mobile device, the port number and the 2nd step port number are the same. (My phone IP address is 192.168.0.120, so the command line input is: ADB connect 192.168.0.120:5555)
You can use ADB, DDMS to debug Android apps or display logcat messages later.
5. If you need to restore to a USB cable, you can enter ADB USB at the command line.
Android Wireless Debugging method