Wireless debugging notes
I’ve been working out of a WeWork for a while, one of the pain is the WeWorkWifi does not allow devices to talk to each other directly, so wireless debugging doesn’t work; and for some reason on my Linux laptop, adb via USB sometimes will decide to stop working. As a workaround, I am now using tailscale on devices I want to debug, and pair using adb
directly, instead of using Android Studio. Prerequisit: both linux laptop and android phone has tailscale installed and active, linux can see the phone IP via > tailscale status
Steps:
-
on android phone, go to wireless debugging, tap “Pair device with pairing code”, a “Pair with device” dialog will appear, note the IP address & port. Assume the value we get is
100.100.220.1:45678
. Also note there is a 6 digit wifi pairing code. -
on Linux, on cli, do
adb pair 100.100.220.1:45678
and enter the wifi pairing code from step 1 when you see “Enter pairing code:” prompt.
- After seeing “Successfully paired to ip:port [guid=….]”, on cli do:
adb connect [ip:port]
where ip:port is what’s shown on IP address & Port section in the Wireless debugging main screen, not the dialog for pairing.
**IP is usually the same, but port for step 3 is different from port in step 1!
- Should see device show up in Android Studio
Other notes:
- Use
adb disconnect
to drop the wireless debugging session. - Use
adb connect ip:port
to reconnect, usually you do not need to pair again, unless the entry is removed from your phone. - use the gear icon in the “Paired devices” section to forget a paired device when needed