Skip to content

Wireless debugging notes

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:

  1. 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.

  2. 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.

  1. 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!

  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

相關文章

  1. [Memo] Services on my RPI
  2. Thinking in Compose
  3. Testing a class that depends on FragmentManager
  4. Notes for Android Emulator on Windows 10 with AMD processor (2021 ver)
  5. Notes for Setting Up Android Development Environment on Windows 10 in 2020
  6. Testing classes using android.view.Menu
  7. Hugo setup notes