Connect an Android 11+ device over ADB Wi-Fi by scanning a QR code from your terminal.
Same protocol as Android Studio's Pair device using Wi-Fi, but without launching the IDE — just run wadb, scan, done.
Requires Go (see go.mod for the minimum version) and adb from Android platform-tools.
go install github.com/lindevhard/wadb@latestHomebrew:
brew tap LinDevHard/tap
brew install wadbOr build from a clone:
git clone https://github.com/LinDevHard/wadb && cd wadb
go build -o wadb .wadbA QR code prints in the terminal. On your phone open
Settings → Developer options → Wireless debugging → Pair device with QR code and scan it. wadb will pair and connect automatically, then exit.
Both the phone and the host must be on the same Wi-Fi network (no AP isolation between clients), and Wireless debugging must be enabled in Developer options.
Useful diagnostics:
wadb doctor
wadb --verbose
wadb --pair-timeout 3m --connect-timeout 45s
wadb --adb /path/to/adb
wadb --pair-only
wadb --qr-ascii
WADB_ADB=/path/to/adb WADB_PAIR_ONLY=true wadbdoctor checks the local adb, starts the server, and prints mDNS services reported by adb mdns services. --verbose prints discovered mDNS entries during pairing.
Use --adb when you want to force a specific Android platform-tools install. Use --pair-only when pairing works but your device delays or hides the _adb-tls-connect._tcp announce; after it exits, connect manually with the host and port shown in Android's Wireless debugging screen. Use --qr-ascii if your terminal font or emulator renders the default compact QR poorly.
The same options can be set with environment variables: WADB_ADB, WADB_PAIR_ONLY, WADB_QR_ASCII, WADB_VERBOSE, WADB_PAIR_TIMEOUT, and WADB_CONNECT_TIMEOUT. CLI flags override environment values. Boolean variables accept values like true, false, 1, or 0; timeout variables use durations like 30s or 3m.
wadblocates the localadbbinary.- It generates a single-use service name (
studio-<random>) and password, then renders them as a QR code with payloadWIFI:T:ADB;S:...;P:...;;— the same format Android Studio uses. - When the phone scans the QR, it advertises
_adb-tls-pairing._tcpvia mDNS.wadbmatches the announce by instance name and runsadb pair. - After pairing succeeds, the phone advertises
_adb-tls-connect._tcp.wadbtries connect endpoints from the same IP as the pairing announce first, then falls back to other discovered endpoints. - After a successful
adb connect,wadbprints the result and, when available, the device name from Android system properties.
The actual TLS pairing handshake is handled by adb pair; wadb only orchestrates discovery and credential generation.
For a deeper explanation of the ADB Wi-Fi pairing flow, mDNS discovery, and newer reconnect improvements, see the Android Makers/droidCon 2026 talk How ADB Wifi 2.0 works.
wadb searches for adb in this order and uses the first match:
$ANDROID_HOME/platform-tools/adb$ANDROID_SDK_ROOT/platform-tools/adb~/Library/Android/sdk/platform-tools/adb(macOS Android Studio default)~/Android/Sdk/platform-tools/adb(Linux default)adbon$PATH(e.g. Homebrewandroid-platform-tools)/opt/homebrew/share/android-commandlinetools/platform-tools/adb
If none match, set ANDROID_HOME or install platform-tools.
| Symptom | Likely cause |
|---|---|
| "did not see device announce within 2m" | Phone could not reach the host over mDNS. Check same Wi-Fi subnet, no AP isolation, firewall not blocking UDP 5353. |
adb pair fails immediately |
Stale daemon. Run adb kill-server and retry. |
| Connect timeout after a successful pair | Some Android builds delay the connect announce. Re-run wadb, or run adb connect <ip>:<port> manually once Wireless debugging shows the device's port. |
| Platform | Status |
|---|---|
| macOS | Supported and tested. |
| Linux | Supported, expected to work as-is. |
| Windows | Experimental. adb discovery is partially implemented and unverified; use --adb or WADB_ADB to point at a known platform-tools install. |
See CONTRIBUTING.md and the Code of Conduct.
