Application scenario:
Wirelessly debug Android applications
Avoid the trouble of disconnection during debugging
Avoid the clutter of multiple mobile phones that need to be connected
Directly say the method:
method one
1. The mobile phone and the computer are connected to the same local area network (together with a WiFi)
2. Check the IP address of the mobile phone under the connected WiFi in the settings of the mobile phone and the network connection (some mobile phones can open the wireless debugging to see the ip) as shown in the figure below 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
adb tcpip 6666
4. Unplug the data cable and enter the command: adb connect <mobile phone IP address>:<port number>, as shown in the figure below, it means success
adb connect 192.168.1.113:6666
5. You can view the connected devices, command: adb devices
adb devices
6. It can be debugged normally.
7. Disconnect, command: adb disconnect <mobile phone IP address>:<port number>
adb disconnect 192.168.1.113:6666
Notice:
The mobile phone needs to turn on USB debugging.
The mobile phone and the computer must be in the same LAN (connected 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.
Method 2 (faster)
1. Android studio search for plug-ins, and install them (there are many. I only tested one of them, and the others are self-debugging). There are detailed introductions in it. 2.
Connect
the mobile phone, open WiFiADB ( NavBar > Tools > WiFiADB ), or use the shortcut key Ctrl+Alt+2
3.
All mobile phones will be displayed here, just click the last content. Because I have already connected in advance. So show it like this
4. If a pop-up window pops up to configure adb path. Then we need to configure it in advance. It can be obtained by this method
. Just check the specified path.
you're done