Control your own Android phone / tablet and Windows PC from an AI agent via a reverse SSH tunnel + adb/Intent/agent HTTP. Code-level control first, with a gated vision layer as fallback execution — never on payment, verification-code or banking surfaces.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of muse-phone-control?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/geisusu-muse-phone-control)
---
name: muse-phone-control
description: Control your own Android phone / tablet and Windows PC from an AI agent via a reverse SSH tunnel + adb/Intent/agent HTTP. Code-level control first, with a gated vision layer as fallback execution — never on payment, verification-code or banking surfaces.
---
# muse-phone-control Skill
## What this does
Lets the agent operate the user's own Android phone through a cloud server:
reverse SSH tunnel (server 127.0.0.1:2222 -> phone adb 5555), plus a local
low-latency agent on the phone (HTTP 127.0.0.1:18080, /ping /input /shot).
## Prerequisites — two tiers (check the tier first)
### Tier A · root, full function (default)
- Rooted Android with KernelSU; KSU service.d runner installed (see scripts/installer/)
- DSH Go (or another proot Ubuntu rootfs) on the phone
- A cloud server with the tunnel account configured (see server/)
- `.env` filled from `.env.example` (never commit it)
### Tier B · no-root, lightweight subset (v3, see docs/REQUIREMENTS.md)
Root is **not** the only door. If Tier A is missing, check Tier B before stopping:
- Android 12+ (14+ recommended), wireless debugging available in system settings
- Wireless-debugging pairing completed once (grants shell-level adb access)
- Capability subset only: adb commands, verified Intents, UI-tree read/locate
fallback. No root agent, no boot persistence, no self-healing tunnel —
wireless debugging drops on reboot / Wi-Fi change and the user must re-pair.
- Always state which tier is active and which capabilities are missing;
never present Tier B as equivalent to Tier A.
## Install (one-click, agent-guided)
Run `scripts/install.sh` and follow it phase by phase:
check (host tools + config) -> config (generates .env + tunnel keypair) ->
server (ssh deploy of tunnel account/sshd hardening) -> phone (adb deploy of
KSU service.d + runner + agent, then reboot) -> verify (tunnel + agent ping).
Each system-changing phase asks the user first. When verify prints READY,
installation is complete; do not declare success before that.
## Devices (added 2026-12-05)
- **Phone (primary)**: full stack below. Tunnel 2222, root agent.
- **Tablet (secondary, no root)**: tunnel 2224 -> adb 3455. Best-effort
keep-alive only; real-PIN lock screen = black screenshots; no root runner.
Read docs/TABLET.md before assigning it work; never promise phone parity.
- **PC (Windows)**: route A Tailscale+SSH = terminal/files only (Session 0,
no mouse). Route B desktop agent in the interactive session = mouse and
keyboard via loopback+token (pc/). Read docs/COMPUTER_CONTROL.md.
MuseLink is a separate unverified route - do not use until the user asks.
PC security defaults (docs/security.md): SSH key-only, password login off;
the desktop agent is reached only via loopback+token through SSH -L /
Tailscale — never port-forward it publicly; Tailscale auth keys expire in
~6 months — re-authorize and audit the device list.
## Operating rules
1. Always run `scripts/doctor.sh` first. If tunnel or agent is down, report
and follow docs/troubleshooting.md; do not improvise fixes with root.
2. Control priority: Intent > adb/agent > UI tree > OCR > vision locate.
Screenshots are verification only, never the primary control method.
UI-tree / OCR / vision are fallback execution only: switch to them only
when a trigger in docs/VISION_LAYER.md is met (e.g. UI tree empty after
one retry, no Intent entry, screen unchanged after 2 code actions),
and whenever one is used, mark that step "unverified path" in the run
record, with its source (ocr / vlm + model name). They never override
the payment / verification-code / slider rules below.
Deep links come from static APK extraction, graded per app and verified
by a test launch before use — see docs/INTENT_OPTIMIZATION.md. Never use
an unverified deep link for a consequential action.
Deep-link status lives in each app's intents.md + TEST_LOG.md: class A
(Manifest-declared: Xianyu / Taobao / Telegram, test-launched and
verified) vs class B (closed: Pinduoduo / Douyin — use the UI-tree /
vision fallback ladder). Extracted ≠ verified: the Meituan / Meituan
Waimai packs are extracted but pending live test; treat any untested
link as an unverified path, banned for consequential actions.
**Vision-layer prohibitions and discipline (docs/VISION_LAYER.md):**
(1) a screenshot-blocked page (FLAG_SECURE black/empty) means stop —
never work around it; (2) banking / wallet / password-manager apps are
banned from the vision layer entirely (denied_packages); a user-named
exception still stores no screenshots; (3) one screenshot may plan at
most 6–8 steps, and any sequence containing a commit action must be cut
before the commit; (4) after execution, verify in three states —
verified / uncertain / stale: uncertain forbids blind re-sends, stale
means pause and hand over immediately; (5) in Ask mode, announce before
the first switch to vision — never switch silently; (6) key fields
(amount, quantity, recipient) must be OCR-read back character by
character.
3. Only call the whitelisted wrappers in `scripts/host/` (adb.sh, intent.sh,
agent.sh, seq.sh). Never assemble arbitrary root shell commands.
For any multi-step task, prefer ONE seq.sh call (steps execute locally
on the phone) over repeated single actions — see docs/LATENCY.md.
Before acting on the phone, check the foreground package: if the user
is actively using another app, abort and report instead of fighting
them for the screen.
3b. **Playbooks first**: before improvising a flow, check docs/PLAYBOOKS.md
and docs/REQUIREMENTS.md for an existing script. /seq hard rules:
Chinese JSON must use ensure_ascii=False; check the foreground package
before AND after the run; grab the UI tree only at head and tail, using
cached coordinates from the device profile in between; check the pause
flag before every step. The three P0 scenario playbooks (food delivery /
shopping / ticket booking — stop at the payment-confirmation page) and
wx_send2 exist but are **not yet live-verified**: until one has passed a
real-device run, treat it as an unverified path.
4. Confirm with the user before: sending messages, deleting anything,
installing apps, changing system settings, or any payment-related screen.
5. Overlay capsule (see docs/OVERLAY.md): every phone task must light the
capsule first (`POST /task/start`) before acting, and close it at the
end (`POST /task/finish`). The three stop points (payment, verification
code, plan choice) must be raised through the state interface
(`POST /task/need-user`, which pauses the agent and shows the capsule
card) — never only announced in chat. If the user taps pause or touches
the screen, the task stays paused until the user resumes it.
If the capsule receives no agent heartbeat for 15 seconds (tunnel down /
server dead), the phone-side agent auto-pauses and the capsule shows
"connection lost, auto-stopped" — loss of link means stop. Capsule state
comes from the phone-local agent, not the tunnel; after reconnecting,
check /state and the capsule before resuming.
6. Never print secrets: no server IP, keys, tokens, or device serials in chat
or logs. Refer to `.env` variable names instead.
## Model division (docs/API_INTEGRATION.md)
Every task is divided, never single-model by default: planning primary +
independent second review; code models get long tasks in small steps; free
quotas run bulk work first. The vision primary must be locked by a
10-real-screenshot grounding test before use — that test is not done yet,
so until it is, the vision layer is read-only (locate / report), no vision
execution.
## Dual mode (v3, borrowed from Mika's Ask/Autonomous)
- **Ask (default)**: act autonomously except stop and ask at exactly three
points — payment (final step), verification codes, and plan choices
(e.g. which flight / flavour). Never solve slider / human-verification
challenges for the user.
- **Autonomous**: only when the user explicitly turns it on for a task or
session. It widens the no-ask range for ordinary steps, but the three stop
points and the slider ban still apply in full — Autonomous never approves
a payment or a verification for the user.
## Quick commands
- Health: `scripts/doctor.sh`
- Screenshot: `scripts/host/agent.sh shot`
- Tap/swipe/key: `scripts/host/agent.sh input ...` (see agent.sh help)
- Open app/activity: `scripts/host/intent.sh "<intent-uri>"` (whitelist in config/policy.example.json)
- Chinese text input goes through the agent's ADBKeyboard broadcast route;
any sequence using it must switch back to the user's original IME at the
end and verify the switch — never leave the IME changed.
## Entry points status
The MCP server entry (wrapping doctor / status / Intent / agent actions as
MCP tools) is **not implemented yet** — see docs/REQUIREMENTS.md and
docs/MIKA_FUSION.md. The current entry points are this Skill plus the
scripts; register the MCP entry here once it is implemented.