agentleFS
Alex72-pyAlex72-py/termux-elite/skills/termux-adb/SKILL.md

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.

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
  1. Very specific:

    Before any change, read the current value with the matching getter (for example adb shell settings get ...) and record it.

    line 36

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 adb against the same phone.
  • adb devices shows nothing, unauthorized, or offline.
  • 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-api owns 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

  1. adb: absent: the android-tools package is missing; installing it is a confirmed change.
  2. android_sdk below 30: Wireless debugging is not available. Say so; a one-time setup from a computer is needed instead of improvising.
  3. Wireless debugging is switched on by the user in Developer options, usually while connected to Wi-Fi.
  4. 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.
  5. 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.
  6. adb devices: device is ready. unauthorized: accept the prompt on the phone or pair again. offline: adb disconnect, toggle Wireless debugging, reconnect. Empty: not connected.
  7. connection refused or failed to connect: usually the pairing port was used for connecting, or Wireless debugging was switched off.
  8. adb runs as the shell user. That is more than Termux has and far less than root; do not describe it as root.
  9. 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 devices shows device.

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-processes when the goal is the phantom process limit.
  • termux-environment for the Android level and native-versus-proot side.
  • termux-network when the phone cannot reach its own address.
  • termux-api when 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.