Target
Based on this article, you will be able to connect a real Android device to Adb on PC via Wifi.
This device will communicate with an Android Wear Emulator (Watch AVD) running on that PC.
Let do it!
1. You must connect your phone to the PC via a USB cable and check on the Adb:
$adb devices
2. Switch the phone connection to Wifi by turning on TCP at port 5555, this operation needs to be repeated every time the device has to be restarted like turning back on after the battery runs out, restarting … generally anytime it boot:
$adb tcpip 5555
3. Now unplug the USB cable, find your device’s IP and connect via Wifi. In my case, the phone has IP: 192.168.1.3:
$adb connect 192.168.1.3:5555
4. Now check the number of connected devices and you will see your device appear.
Since I run Watch AVD, there will be 2 devices:
$adb devices
5. To connect to the Watch AVD, the phone needs to have Wear OS installed. You have to perform port 5601 mapping from the phone to the PC. This action needs to be repeated every time the phone is connected to Adb:
$adb -s 192.168.1.3:5555 -d forward tcp:5601 tcp:5601
6. Open Wear OS and select “Pair with simulator” and done
Hopefully this article will help someone save a lot of hours of research.
Wish everyone success!
Bản tiếng việt