Control an Android or Huawei HarmonyOS phone from a Windows PC with Codex, ADB, and scrcpy.
This repository packages a reusable Codex Skill for phone-to-PC screen mirroring, PC-side control, screenshots, app launching, form filling, and bounded operation inside an explicitly authorized mobile app.
Many real-world agent workflows still need a phone:
- mobile-only marketplace publishing flows
- QR continuation from a desktop website
- app-only image pickers
- phone-only verification steps
- mobile customer service or shop operations
This skill gives an agent a repeatable, safety-bounded way to use a phone without improvising every time.
- Works with most Android-compatible phones through USB debugging
- Supports Huawei HarmonyOS phones
- Uses open-source
scrcpyfor low-latency mirroring - Uses ADB for deterministic taps, screenshots, UI dumps, and app launching
- Includes safety rules so the agent only operates the app the user authorized
- Includes optional browser screenshot mirror, disabled by default
- Designed as a reusable Codex Skill
Known-good target families:
| Family | Notes |
|---|---|
| Google Pixel / stock Android | Standard ADB flow |
| Samsung One UI | Standard Developer Options flow |
| Xiaomi / Redmi / POCO / HyperOS | May require USB debugging security settings |
| OPPO / OnePlus / ColorOS | Standard ADB flow, sometimes extra prompts |
| vivo / iQOO / OriginOS | Standard ADB flow, sometimes extra prompts |
| Honor MagicOS | Similar to Android/HarmonyOS flow |
| Huawei HarmonyOS 3/4/5 | Enable USB debugging; some phones expose charge-only ADB toggle |
Not supported:
- iPhone / iOS, because iOS does not expose ADB/scrcpy-style PC control
- phones where USB debugging is disabled by policy or MDM
Install the skill into your Codex skills directory:
Copy-Item -Recurse .\skills\phone-pc-screen-sync-control "$env:USERPROFILE\.codex\skills\phone-pc-screen-sync-control"Connect your Android/HarmonyOS phone by USB, enable USB debugging, then ask Codex:
Use 手机PC端投屏同步操作 to connect my Android phone and open scrcpy.
Or run the helper script directly:
.\skills\phone-pc-screen-sync-control\scripts\connect-phone.ps1 -InstallScrcpyIfMissing -StartScrcpy- Enable Developer Options on the phone.
- Turn on USB debugging.
- Plug the phone into the PC with a data cable.
- Accept the RSA debugging prompt on the phone.
- Start scrcpy from Codex or PowerShell.
- Let Codex operate only the app/workflow you explicitly authorize.
- Stop control with
stop-phone-control.ps1when finished.
The skill tells Codex to:
- operate only the app and workflow the user authorized
- ask before touching payments, account settings, private chats, real-name verification, or unrelated photos
- prefer desktop/web flows when they can complete the task
- use phone control only for app-only flows, QR continuation, image picker steps, or mobile-only verification
- avoid continuous browser screenshot mirroring unless explicitly requested
skills/phone-pc-screen-sync-control/
SKILL.md
agents/openai.yaml
references/troubleshooting.md
scripts/connect-phone.ps1
scripts/capture-screen.ps1
scripts/start-browser-mirror.ps1
scripts/stop-phone-control.ps1
- Publish app-only marketplace listings without guessing phone steps
- Continue a desktop flow by scanning or opening a mobile-only path
- Fill mobile app forms from PC clipboard
- Capture phone screenshots for debugging
- Operate a spare Android phone as an agent-controlled work device
You are building agents that need to operate real mobile apps, not just websites.
PRs for macOS/Linux setup scripts, more phone vendors, and safer app-specific playbooks are welcome.
MIT