termux-adb
Skill2 starsChanged 57 days agoMITView on GitHub
Set up and debug adb from Termux to the same phone using Wireless debugging (pairing code, connect port, unauthorized or offline devices) for the few tasks that need shell-level access. Use when the user mentions adb pair, adb connect, wireless debugging, android-tools, adb devices showing unauthorized or offline, or when another skill hands off a system setting that needs adb. Do NOT use for Termux:API permission errors (see termux-api), for USB debugging from a PC, or to change a system setting without confirmation.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- background-processesSkill
- git-credentialsSkill
- github-actionsSkill
- node-native-buildSkill
- package-troubleshootingSkill
- proot-boundariesSkill
- python-native-buildSkill
- storage-permissionsSkill
- termux-apiSkill
- termux-backupSkill
- termux-environmentSkill
- termux-networkSkill
- termux-servicesSkill
- termux-sshdSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Before any change, read the current value with the matching getter (for example adb shell settings get ...) and record it.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Termux ADB
Purpose
Establish and verify adb access from Termux to its own device only when a task needs shell-level privileges, and tear it down afterwards.
When to use
- Setting up Wireless debugging so Termux can run
adbagainst the same phone. adb devicesshows nothing,unauthorized, oroffline.- Another skill needs an adb-only change, for example the phantom process limit in
background-processes.
When NOT to use
- Termux:API permission problems:
termux-apiowns those. - Anything achievable without adb. adb is shell-user access to the whole device, not a convenience.
Preconditions
Wireless debugging exists from Android 11 (API 30). Developer options must be enabled by the user. sh scripts/check-adb.sh prints adb state read-only; it never starts the adb server, pairs, or connects.
Decision tree
adb: absent: theandroid-toolspackage is missing; installing it is a confirmed change.android_sdkbelow 30: Wireless debugging is not available. Say so; a one-time setup from a computer is needed instead of improvising.- Wireless debugging is switched on by the user in Developer options, usually while connected to Wi-Fi.
- Pair once. The "Pair device with pairing code" dialog shows an address, a pairing port, and a six-digit code:
adb pair <address>:<pairing-port>, then enter the code. The dialog closes if Termux takes the whole screen, so use split-screen or a floating window. - Connect with the other port. The main Wireless debugging screen shows a different port:
adb connect <address>:<connect-port>. Pairing persists, but the connect port changes when Wireless debugging is toggled or the network changes. adb devices:deviceis ready.unauthorized: accept the prompt on the phone or pair again.offline:adb disconnect, toggle Wireless debugging, reconnect. Empty: not connected.connection refusedorfailed to connect: usually the pairing port was used for connecting, or Wireless debugging was switched off.- adb runs as the
shelluser. That is more than Termux has and far less than root; do not describe it as root. - Before any change, read the current value with the matching getter (for example
adb shell settings get ...) and record it.
Example
- Situation: adb connect fails with connection refused right after a successful adb pair.
- Without the skill: Pairs again and again with new codes.
- With the skill: Notes the pairing port differs from the connect port, reads the connect port from the main Wireless debugging screen, connects, and confirms
adb devicesshowsdevice.
Safety
adb gives shell access to the whole device. Treat the pairing code as a secret and do not repeat it in logs. Keep Wireless debugging off when not needed and never leave adb tcpip listening on an untrusted network. Every setting change is system-wide: state the exact command and how to revert it, then get explicit confirmation.
Verification
adb devices lists the device as device, and adb shell getprop ro.build.version.sdk returns the API level. After a change, read it back with the same getter used to record the original.
Rollback
Restore each recorded setting to its original value, run adb disconnect, stop the server with adb kill-server, switch off Wireless debugging, and revoke authorizations in Developer options on a shared device.
Handoffs
background-processeswhen the goal is the phantom process limit.termux-environmentfor the Android level and native-versus-proot side.termux-networkwhen the phone cannot reach its own address.termux-apiwhen the real failure is a Termux:API permission.
Report
adb state before and after, the one setting changed with its original value, and whether Wireless debugging was switched back off.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

