Android shell commands
Execute shell commands on the device through a checked gateway, with output analysed rather than blindly followed.
When to use
- Diagnostics:
getprop,dumpsys(bounded subsets),pmqueries. - Inspecting package/process/network state that has no dedicated tool.
- Small, reversible operations when a dedicated skill is not available.
Tools used
shell— run a bounded command; outputs parsed and returned as data.verify— confirm the transport is healthy before expensive commands.
Allowlist discipline
Prefer read-only families: getprop, dumpsys (narrow queries), pm list,
settings get, df, ls, logcat -d -t <limit>. Mutating families
(pm uninstall, settings put, am force-stop, rm) require confirm=true
and explicit human approval; treat them as exceptional.
Procedure
- State the exact command and why (never a surprise shell).
- For mutating commands: show the human and get
confirm=true. - Run with a bounded timeout; never a fire-and-forget background process.
- Parse the output; never treat
exit 0alone as success — check the result.
Security
- This is a privileged channel: keep it allowlisted and auditable.
- Never use the shell to bypass a gate that a dedicated tool would refuse.
Related skills
android-adb · android-apps · android-files · android-control