device-shell

device-shell is a skill for Claude Code, Codex from qiannianhuanxiang/DSHA. It costs 38 tokens per session (745 once invoked), scanned A, original, MIT.

A procedure for running commands on an Android phone or other Android device from a Linux-based environment. It uses ADB, Android’s standard debugging connection, and can optionally use a local Shizuku HTTP shell bridge.

In plain words
What is it for?
It helps retrieve device details, list installed apps, launch an app, check which app is in the foreground, and run Android shell commands such as package or activity tools.
Why use it?
It provides a documented way to inspect and control a connected Android device when the agent itself is running in Linux or a similar environment. It also clarifies that normal ADB access usually has limited permissions rather than full administrator access.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps retrieve device details, list installed apps, launch an app, check which app is in the foreground, and run Android shell commands such as package or activity tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/qiannianhuanxiang/dsha/device-shell
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add qiannianhuanxiang/DSHA --skill device-shell
Clone the repo
git clone --depth 1 https://github.com/qiannianhuanxiang/DSHA

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for device-shell

README.md
[![agentmods](https://agentmods.dev/badge/skills/qiannianhuanxiang/dsha/device-shell.svg)](https://agentmods.dev/skills/qiannianhuanxiang/dsha/device-shell)
Your own site
<a href="https://agentmods.dev/skills/qiannianhuanxiang/dsha/device-shell"><img src="https://agentmods.dev/badge/skills/qiannianhuanxiang/dsha/device-shell.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 745 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.00745
Opus 5 $0.00019 $0.00373
Sonnet 5 $0.00008 $0.00149
Haiku 4.5 $0.00004 $0.00075

Measured 9d ago against content hash 164319af3762, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

device-shell scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sG 'http://127.0.0.1:<port>/exec' --data-urlencode 'cmd=<command>'
agent-skills/device-shell/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Android Device Shell

Run commands on an Android device from a Linux-based agent environment.

The device is reachable through ADB. Replace <serial> with the actual device serial shown by adb devices.

adb -s <serial> shell '<device shell command>'

Examples:

# identity / basic info
adb -s <serial> shell 'id; getprop ro.product.model; getprop ro.build.version.release'

# list packages
adb -s <serial> shell pm list packages

# launch an app to foreground
adb -s <serial> shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.LAUNCHER <package>
adb -s <serial> shell am start -n <resolved-component>

# check current foreground app
adb -s <serial> shell dumpsys window | grep -E 'mCurrentFocus|mFocusedApp'
adb -s <serial> shell dumpsys activity activities | grep -E 'ResumedActivity'

Notes:

  • ADB shell usually runs as uid=2000(shell), not root.
  • Use am, pm, input, dumpsys, getprop, cmd for Android-specific operations.

Channel 2: Local Shizuku HTTP bridge

Some Android host apps expose a local HTTP shell bridge. A common pattern is:

curl -sG 'http://127.0.0.1:<port>/exec' --data-urlencode 'cmd=<command>'

Response is JSON:

{"result":"<command output>\n[EXIT=<code>]"}

If it returns a service-not-ready marker such as [SHIZUKU_SERVICE_NOT_READY], the Shizuku UserService has not been bound yet. Restart the host app/service after granting Shizuku permission, then try again.

Channel 3: Termux environment (DSHA)

When the agent runs inside Termux (not proot), destructive commands are wrapped and require user confirmation:

  • rm, dd, mkfs*, fdisk, reboot, shutdown, halt, poweroff, wipe, pm, sm, settings are replaced by wrappers in ~/dsh-bin/ (prepended to PATH by the DSHA launcher).
  • Running one triggers a termux-dialog confirmation popup on the device ("DSHA 安全确认:模型试图执行 [...]"). The command blocks until the user checks "允许" (allow) or cancels.
  • If rejected, or Termux:API (termux-api package) is not installed, the wrapper exits non-zero. Treat a non-zero exit as "user denied" — do not retry the same destructive command; ask the user or choose a safer path.

Read the full file on GitHub · 81 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 81 lines · 38 tokens per session scan A 164319af3762

Subscribe to this mod's changes

device-shell is a skill published in the GitHub repository qiannianhuanxiang/DSHA (392 stars, last pushed 4d ago), licensed MIT. It adds 38 tokens to every session and 745 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

kotlin-expert

Expert-level Kotlin development, Android, coroutines, and multiplatform. Use when the user mentions Android, coroutines, multiplatform, or JVM, or when the task involves Kotlin Fundamentals, Android Development, Kotlin Multiplatform, or Kotlin Style.

personamanagmentlayer/pcl · 55 tokens

Phone Use

MUST Load this skill for ANY task that involves GUI interaction or device control — opening apps, tapping, typing, scrolling, swiping, Back/Home/Recents, reading the screen, or any workflow that touches on-screen content. Load this even when the user does not explicitly mention the device — if the task implies a GUI…

niki914/zafiro · 76 tokens

release-new-version

Use when the user wants to release a new Zafiro version — drafting bilingual release notes, deciding the next version number, bumping app/build.gradle.kts, tagging, and publishing to GitHub (main repo, optionally the Xposed repo).

niki914/zafiro · 54 tokens

autofish-control

Control Android devices with Autofish via the af CLI. Use this skill when you need reliable observe-act-verify loops, ref-based tapping, overlay management, screenshots, and recovery steps.

felinics/Autofish · 42 tokens

dart-expert

Expert-level Dart, Flutter, mobile development, and cross-platform apps. Use when the user mentions Flutter, mobile, cross platform, or widgets, or when the task involves Dart Language or Flutter Framework.

personamanagmentlayer/pcl · 44 tokens

android-expert

Expert in Android development with Jetpack Compose, Material Design, ViewModel, and modern Android architecture. Use when the user mentions mobile, Kotlin, Jetpack Compose, Material Design, or Google, or when the task involves Android Architecture, Android Components, Jetpack Libraries, or Activity/Fragment Lifecycle.

personamanagmentlayer/pcl · 64 tokens