/adb-ops:wireless-adbfrom adb-ops
Connects adb to an Android phone over Wi-Fi (Android 11+ wireless debugging), pairs a new host, and sets up automatic reconnection when on LAN.
Ships in adb-ops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Wireless debugging (Settings → Developer options → Wireless debugging) has three properties that shape everything below:
~/.android/adbkey
on that host). After that, adb connect needs no code._adb-tls-connect._tcp, but mDNS often does not cross from a wired host to Wi-Fi clients.
So find the port with a port scan of the phone's reserved IP instead.The phone needs a DHCP reservation so its IP stays fixed. Phones use a randomised per-network MAC, so reserve against the MAC it shows on this network. On the phone, set that network's Wi-Fi privacy to the device MAC if the reservation keeps missing.
<workspace>/network.env on the host that connects (see ../_shared/workspace.md for
<workspace>):
ADB_HOSTS="10.0.0.52 10.0.0.119" # the phones' reserved IPs (a pool); each one is tried in turn
ADB_HOST=10.0.0.52 # single-phone form; used when ADB_HOSTS is unset. pair-qr reads it for its port-scan fallback
ADB_FIXED_PORT=5555 # used after `adb tcpip 5555`; harmless if closed
ADB_PORT_RANGE=30000-49999 # where wireless debugging puts its connect port
ADB_AUTOPIN_HOSTS="" # optional: phones to move onto ADB_FIXED_PORT (`adb tcpip`) right after a random-port connect
The script writes <workspace>/network-state-<ip>.json per phone with the last port that worked
(an old single network-state.json is renamed on first run). Exit 1 means at least one phone was on the
LAN but no port accepted adb. A phone that is off the LAN is skipped quietly.
Add a phone to the pool: pair this host with it once (pair-qr, run on this host, or the pairing
code route below), give it a DHCP reservation, and append its IP to ADB_HOSTS. The timer picks it up on
its next run.
Needs the user at the phone. If the host has a screen, prefer the QR route (pair-qr skill).
With a pairing code instead:
IP:port. The pairing port differs from the
connect port.adb pair <IP>:<pairing-port> <code>. Expect Successfully paired.adb connect <IP>:<connect-port> with the
port shown on the Wireless debugging screen.adb devices -l, then run device-status.If pairing fails with a timeout, the dialog was closed or the code expired. Ask for a fresh one.
adb devices -l # already connected?
<skill-dir>/scripts/adb-autoconnect.sh # fixed port, last port, then scan
The skill directory is ${CLAUDE_PLUGIN_ROOT}/skills/wireless-adb. If that variable is unset
(the skill was read from the catalogue), clone danielrosehill/Claude-ADB-Ops-Plugin and use
the path inside it.
Exit codes: 0 connected or phone not on the LAN, 1 phone is up but nothing accepted adb
(wireless debugging off, or this host isn't paired), 2 no config.
Install on the host as systemd user units. The host needs adb (Debian/Ubuntu package
adb) and nmap, plus lingering so the units run without a login session:
loginctl enable-linger $USER.
install -Dm755 scripts/adb-autoconnect.sh ~/.local/bin/adb-autoconnect
install -Dm644 -t ~/.config/systemd/user scripts/systemd/adb-server.service \
scripts/systemd/adb-autoconnect.service scripts/systemd/adb-autoconnect.timer
adb kill-server # hand the server over to the unit
systemctl --user daemon-reload
systemctl --user enable --now adb-server.service adb-autoconnect.timer
adb-server.service runs adb server nodaemon permanently. Without it, the adb server
would start inside the oneshot unit and systemd would kill it, dropping the connection, as
soon as the oneshot finished.adb-autoconnect.timer runs the script every 2 minutes. Logs go to
journalctl --user -u adb-autoconnect.adb-server.service is up, as the same user, so the key and the
connection belong to that server.Verified 2026-10-28 on a OnePlus Nord 3 (CPH2493, Android 16) from an Ubuntu 26.04 server: paired, then the scan found the connect port and connected in one run.
adb tcpip 5555 over a wireless-debugging connection: mixed results, so it is opt-in. On
2026-10-28 (OnePlus CPH2493, Android 16) it switched wireless debugging off and 5555 never opened, so
the host lost the phone until wireless debugging was turned back on by hand. On 2026-11-18, on the
same model (build CPH2493_16.0.5.1001(EX01)), it worked: 5555 opened, and the 5555 connection stayed
device with adb_wifi_enabled set to 0. The cause of the difference is unknown. A 5555 pin lasts
until reboot.
ADB_AUTOPIN_HOSTS lists phones the script re-pins automatically: after connecting on a random port
it runs tcpip $ADB_FIXED_PORT and reconnects on that port (it retries for about 12 s, then logs and
waits). Only list a phone where tcpip over wireless was tested to work and something on the
phone turns wireless debugging back on if the pin fails. Otherwise a failed pin loses the phone until
someone toggles wireless debugging by hand. A Tasker profile works well for this: every 10
min it reads adb_wifi_enabled, and if it is 0 and an HTTP GET to the home server returns the
expected page, it sets it back to 1 (Tasker needs pm grant <tasker pkg> android.permission.WRITE_SECURE_SETTINGS; Location is not needed, unlike Tasker's Wifi Connected state, which did not fire with Location off in testing on Android 16, with or without an SSID or IP filter).
Pairing is permanent: the phone keeps the host's key until "Revoke USB debugging
authorisations" is used. Unless "Disable adb authorisation timeout" is on in Developer
options, Android revokes keys unused for 7 days (settings get global adb_allowed_connection_time returns 0 when the timeout is off).
What does have to come back is wireless debugging itself, which Android switches off when the phone leaves the Wi-Fi network. Let an automation app on the phone switch it back on:
adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_SECURE_SETTINGS
(MacroDroid: com.arlosoft.macrodroid).Global, Name adb_wifi_enabled, Value 1.The host's timer then reconnects within 2 minutes.
The adb server listens on localhost only. To run adb on the host from elsewhere, go through
the host (SSH, or a tool that runs commands there). Exposing the adb server to the network
with adb -a is not set up.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
adb-ops@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin adb-ops15 skills in this plugin
/app-auditExport the full list of apps on an Android phone over ADB (name, version, installer, install date, last used, size, special access such as accessibility, device admin or install-unknown-apps) and find apps not opened in a long time, then let the user pick which to uninstall in a feedback form (Remove / Keep for now / Ask me). Keep and remove answers are remembered, so the next audit only asks about new candidates. Use on "unused apps", "what apps haven't I used", "export my app list", "app inventory", "which apps can I delete"./bloatware-logView, search, and summarise the bloatware operations log at <workspace>/bloatware-log.jsonl. Use when the user asks "what bloatware did I remove", "show my debloat history", "what did I disable on this phone", or wants to audit past package operations before restoring something./