| name | connecting-over-wifi |
| description | Use this skill to connect ADB to an Android 11+ device wirelessly with the modern `adb pair` flow (pairing code or QR via `Settings → Developer options → Wireless debugging`), then `adb connect <host:port>` and `adb disconnect`, plus mDNS auto-discovery via `adb mdns check` / `adb mdns services` and the `_adb-tls-pairing._tcp` / `_adb-tls-connect._tcp` service types. Covers the ADB v34+ default mDNS backend (Openscreen on Linux/Windows, not Bonjour as the public doc says), the legacy `adb tcpip <port>` + `adb connect` path that pre-dates pairing, security caveats (corporate Wi-Fi blocks p2p; flat LAN exposure), version requirements (Android 11/API 30 for phones, Android 13/API 33 for TV+Wear), and the `ADB_MDNS_OPENSCREEN` / `ADB_MDNS_AUTO_CONNECT` environment variables. Use when the user mentions `adb pair`, `adb connect`, "wireless debugging", "QR code pairing", `_adb-tls-connect`, "Openscreen vs Bonjour", `adb tcpip 5555`, or "device not connecting after pairing successfully". |
| license | Apache-2.0. See LICENSE for complete terms. |
| metadata | {"author":"Jaewoong Eum (skydoves)","keywords":["adb-pair","adb-connect","wireless-debugging","mdns","openscreen","tls-pairing","tcpip","android-11","ADB_MDNS_OPENSCREEN","corporate-wifi"]} |
Connecting Over Wi-Fi — adb pair (Modern) and adb tcpip (Legacy)
Android 11 introduced a paired wireless debugging flow that replaces the legacy adb tcpip dance. The modern path encrypts and authenticates over TLS using a pairing-code-derived shared secret and uses ephemeral ports; the legacy path leaves an unauthenticated TCP listener on a well-known port. This skill covers both, plus the mDNS plumbing the host server uses to discover paired devices.
When to use this skill
- The user wants to connect a phone to ADB without a USB cable.
- The user mentions
adb pair, QR-code pairing, the "Wireless debugging" toggle in Developer options, or pairing codes.
- The user copies
adb tcpip 5555 && adb connect 192.168.1.100:5555 from an old blog and asks why a modern phone treats that as insecure.
- The user sees
connection refused after pairing and is on a corporate Wi-Fi.
- The user sees mDNS Bonjour vs Openscreen confusion in
adb mdns check.
When NOT to use this skill
- The user wants USB device basics (selector flags, RSA dialog, udev rules) — use
../connecting-to-devices/SKILL.md.
- The user wants the architecture / env-var cheat sheet — use
../../architecture/understanding-adb-architecture/SKILL.md.
- The user wants to run a test on the wirelessly connected device — use
../../tests/running-instrumented-tests-via-adb/SKILL.md.
Prerequisites
- Workstation and device on the same Wi-Fi network. Corporate networks frequently block p2p — see step 6.
- Phones / tablets: Android 11 (API 30)+. TV / Wear OS: Android 13 (API 33)+.
- Working ADB server (see
../../architecture/understanding-adb-architecture/SKILL.md).
- Wireless debugging enabled on-device:
Settings → System → Developer options → Wireless debugging.
Workflow
Patterns
Pattern: WRONG vs RIGHT — using adb tcpip on Android 13
adb tcpip 5555
adb connect 192.168.1.100:5555
adb pair 192.168.1.100:42999
adb connect 192.168.1.100:39555
adb devices
Pattern: WRONG vs RIGHT — pairing port confused with connect port
adb pair 192.168.1.100:42999
adb connect 192.168.1.100:42999
adb mdns services
adb connect 192.168.1.100:39555
Pattern: WRONG vs RIGHT — mDNS Openscreen vs Bonjour expectations
adb mdns check | grep -q bonjour || exit 1
ADB_MDNS_OPENSCREEN=1 adb start-server
adb mdns check
ADB_MDNS_OPENSCREEN=0 adb start-server
Mandatory rules
- MUST prefer
adb pair + adb connect on Android 11 (API 30) phones / Android 13 (API 33) TV+Wear. The adb tcpip path is the legacy fallback.
- MUST use the connect port (from
_adb-tls-connect._tcp or the Wireless debugging main screen) for adb connect, not the pairing port shown by the pairing-code dialog.
- MUST disable wireless debugging on the device when not actively using it. The Settings toggle kills the listening sockets immediately.
- MUST NOT assume the mDNS backend is Bonjour. ADB v34+ defaults to Openscreen on Linux/Windows. Pin with
ADB_MDNS_OPENSCREEN=0|1 if reproducibility is required.
- MUST NOT run
adb tcpip 5555 on shared/public Wi-Fi. The result is an unauthenticated open TCP listener until reboot.
- PREFERRED: plug into the office Ethernet or use a personal hotspot when corporate Wi-Fi blocks p2p.
- PREFERRED:
adb mdns check and adb mdns services are the first diagnostic step when wireless debugging "just stops working."
Verification
References
- Wireless ADB (developer.android.com/tools/adb#wireless): https://developer.android.com/tools/adb#wireless
- ADB user guide root: https://developer.android.com/tools/adb
- Platform-tools release notes (mDNS backend defaults): https://developer.android.com/tools/releases/platform-tools
- AOSP
adb man page: https://android.googlesource.com/platform/packages/modules/adb/+/refs/heads/main/docs/user/adb.1.md
tasks/research/A1-adb-architecture-devices.md — ADB v34+ Openscreen-vs-Bonjour default flip on Linux/Windows, mDNS service-type taxonomy, and the verbatim "Device not connecting after pairing successfully" guidance.
docs/CORPUS.md §I.4 (wireless ADB).
- Sibling skills:
- High-level architecture and env vars:
../../architecture/understanding-adb-architecture/SKILL.md
- USB device basics:
../connecting-to-devices/SKILL.md
- App install/clear:
../../apps/installing-and-managing-apps/SKILL.md
- Run instrumented tests over a wireless transport:
../../tests/running-instrumented-tests-via-adb/SKILL.md
- Cross-set neighbours:
- Run instrumented tests with
AndroidJUnit4: ../../../instrumentation/runner/running-instrumented-tests-with-androidjunit4/SKILL.md
- Configure JUnit4 on Android:
../../../jvm-tests/runner/configuring-junit4-on-android/SKILL.md
- Source-set strategy:
../../../fundamentals/strategies/organizing-test-source-sets/SKILL.md