Reference link Address:
Https://developer.android.com/studio/command-line/adb
In general, use the ADB via USB. However, you can also use it via WLAN as described below.
Connect your Android device and the ADB host computer to a common Wi-Fi network that both can access. Note that not all access points are applicable; You may need to use an access point that has the firewall configured correctly to support ADB access points.
Note: If you try to connect to an Android Wear device, force it to connect to the WLAN by turning off Bluetooth on the phone to which it is connected.
- Connect the device to the host computer using a USB cable.
- Set the target device to listen for TCP/IP connections on port 5555.
$ adb tcpip 5555
- Disconnect the USB cable from the target device.
- Find the IP address of your Android device. For example, on a Nexus device, you can access Settings > About tablet(or about phone) > Status > IP address to find IP addresses. Or, on an Android Wear device, you can access Settings > Wi-Fi Settings > Advanced > IP address Locate the IP address.
- Connect to the device and identify the device by IP address.
device_ip_address
- Make sure your host computer is connected to the target device:
$ adb deviceslist of devices attached device_ip_address : 5555 Device
Now you're ready to go!
If the ADB connection is lost:
- Make sure that your console is still connected to the same WLAN network as your Android device.
- Reconnect by performing the
adb connect
steps again.
- If you cannot connect, reset the ADB host:
ADB kill-server
Then, start the operation from the beginning.
ADB command has no data cable and can be used under WLAN