Wear OS supports wireless debugging, which lets you debug your app over a Wi-Fi network.
Prerequisites
Before you begin, verify that you have the following:
- Android Debug Bridge (ADB): Use
adbversion 30.0.0 or higher. Same Wi-Fi network: Your development computer and the Wear OS watch must be connected to the same Wi-Fi network.
Enable wireless debugging
- Enable developer options on your watch.
- On the watch, open Settings and navigate to Developer options.
- Enable ADB debugging.
Enable Wireless debugging.
In the dialog that appears, select Allow or Always allow on this network to confirm.
Pair your computer with the watch
You only need to pair your computer with the watch once.
- On the watch, navigate to Settings > Developer options > Wireless debugging.
- Select Pair new device.
- The watch displays a Wi-Fi pairing code, an IP address, and a Port for pairing. Note these values.
On your computer, open a terminal and run the following command, replacing
ip-addressandpairing-portwith the values shown on the watch:adb pair ip-address:pairing-portWhen prompted, enter the Wi-Fi pairing code shown on the watch. If pairing succeeds, you see a message similar to:
Successfully paired to ip-address:pairing-port
Connect to the watch
After the watch and computer pair, you can connect to the watch. You need to reconnect each time you restart wireless debugging or change Wi-Fi networks.
- On the watch, navigate to Settings > Developer options > Wireless debugging.
Find the IP address and Port for the connection under Wireless debugging (not under "Pair new device").
On your computer, run the following command:
adb connect ip-address:connection-portVerify the connection by running:
adb devicesYour watch should appear in the list of connected devices.
If this command returns more than one device, preface your
adbcommands with the IP address of the device:adb -s ip-address:connection-port
Troubleshooting
If you are unable to connect, do the following:
- Check network connection: Check that both devices are on the same Wi-Fi network and that the network allows peer-to-peer traffic.
- Restart ADB: On your computer, run
adb kill-serverand thenadb start-server, then try connecting again. - Toggle debugging: Turn Wireless debugging off and back on on the watch.