Agent skill

Phoneagent

by rounak in rounak/PhoneAgent

Control a connected iPhone, iOS simulator, Android emulator, or Android device from macOS through PhoneAgent's JSON-RPC bridge.

MITAuto-check passedMobile

Install Phoneagent

skills CLI
$ npx skills add rounak/PhoneAgent --skill phoneagent -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rounak/PhoneAgent phoneagent --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rounak/PhoneAgent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/phoneagent .claude/skills/phoneagent && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
phoneagent
GitHub stars
798
Token cost
~2.2k tokens
SKILL.md length
799 words
Files
6 (incl. scripts)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Control a connected iPhone, iOS simulator, Android emulator, or Android device from macOS through PhoneAgent's JSON-RPC bridge.

  • Works in 3 steps: Keep the bridge process running. → Wait for PHONEAGENT_RPC_READY ... in… → Confirm socket readiness before first RPC
  • Users ask to automate mobile UI actions
  • SKILL.md covers Start the RPC bridge, Resolve host and port, Send RPC calls and Core operating loop, plus 5 more sections
  • Runs Python and Shell scripts from its folder; calls python3, python and xcodebuild

What it does

Phoneagent is an agent skill from rounak/PhoneAgent. Control a connected iPhone, iOS simulator, Android emulator, or Android device from macOS through PhoneAgent's JSON-RPC bridge. Use when users ask to automate mobile UI actions, inspect accessibility trees, toggle Settings switches, navigate apps, or capture screenshots by sending RPC methods like gettree, getscreenimage, getcontext, tapelement, entertext, scroll, swipe, and openapp.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts (for example `scripts/android_rpc_bridge.py`, `scripts/forward_rpc_localhost.py` and `scripts/rpc.py`).

It sits in Mobile, covering Mobile UI design, Mobile testing and debugging and iOS development. It works with Android, iOS, macOS and Python. The repository describes itself as: An AI agent that can get things done across iPhone apps. The licence is MIT.

When your agent uses it

  • Users ask to automate mobile UI actions
  • Inspect accessibility trees
  • Toggle Settings switches
  • Capture screenshots by sending RPC methods like gettree

Example prompts

  • “/phoneagent”

Requirements

  • Python 3
  • A Bash shell

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Keep the bridge process running.
  2. Wait for PHONEAGENT_RPC_READY ... in logs before sending RPC calls.
  3. Confirm socket readiness before first RPC

What it can do on your machine

Read from SKILL.md and the folder at commit 4f0e201. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 5 files in scripts/ (Python and Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • python
    • xcodebuild
    • adb
    • git
    • xcrun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Phoneagent loads about 2.2k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 799 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from rounak/PhoneAgent at commit 4f0e201, republished under its MIT licence (© rounak). 799 words, ~2,182 tokens.

Download SKILL.mdSave it as .claude/skills/phoneagent/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
phoneagent
description
Control a connected iPhone, iOS simulator, Android emulator, or Android device from macOS through PhoneAgent's JSON-RPC bridge. Use when users ask to automate mobile UI actions, inspect accessibility trees, toggle Settings switches, navigate apps, or capture screenshots by sending RPC methods like get_tree, get_screen_image, get_context, tap_element, enter_text, scroll, swipe, and open_app.

PhoneAgent

Use this workflow to drive iOS or Android UI through PhoneAgent's JSON-RPC bridge.

All shell commands below assume you are in the repo root:

bash
cd "$(git rev-parse --show-toplevel)"

Start the RPC bridge

  1. Choose a platform bridge (both listen on 127.0.0.1:45678 by default).
bash
# iOS (XCTest-hosted bridge)
./.agents/skills/phoneagent/scripts/start_rpc_bridge_local.sh

# Android (adb bridge; emulator or physical device)
./.agents/skills/phoneagent/scripts/start_android_rpc_bridge_local.sh

Notes:

  • start_rpc_bridge_local.sh is interactive and will show a numbered list of iOS devices/simulators. Enter the number for the destination you want.
  • start_rpc_bridge_local.sh starts a localhost-only forwarder.
  • On Xcode "Connect via network", it uses the CoreDevice tunnel automatically (no extra deps).
  • For USB fallback forwarding, install pymobiledevice3 into a local venv: python3 -m venv .venv && ./.venv/bin/python -m pip install -U pip && ./.venv/bin/python -m pip install pymobiledevice3
  • start_android_rpc_bridge_local.sh uses adb; if multiple devices are connected it prompts for the serial.
  1. Keep the bridge process running.
  2. Wait for PHONEAGENT_RPC_READY ... in logs before sending RPC calls.
  3. Confirm socket readiness before first RPC:
bash
./.agents/skills/phoneagent/scripts/rpc.py get-tree >/dev/null && echo rpc-ready

Resolve host and port

  1. Always use 127.0.0.1:45678 as the RPC endpoint (or rpc.py --port <port> if customized).

Notes:

  • Both bridges are localhost-only.
  • iOS physical-device flow uses a localhost forwarder.
  • If you need to forward manually, first get a device UDID via xcrun devicectl list devices, then run: python3 ./.agents/skills/phoneagent/scripts/forward_rpc_localhost.py --udid <UDID> (binds 127.0.0.1:45678)

Send RPC calls

Use the helper CLI:

bash
# iOS bundle identifier
./.agents/skills/phoneagent/scripts/rpc.py open-app com.apple.Preferences

# Android package name
./.agents/skills/phoneagent/scripts/rpc.py open-app com.android.settings
./.agents/skills/phoneagent/scripts/rpc.py get-tree | head

# Use coordinates copied from the tree (XCUI frame string).
./.agents/skills/phoneagent/scripts/rpc.py enter-text \
  --coordinate '{{33.0, 861.0}, {364.0, 38.0}}' \
  --text 'Display'

./.agents/skills/phoneagent/scripts/rpc.py tap-element \
  --coordinate '{{37.7, 969.7}, {199.7, 29.0}}'

Core operating loop

  1. Call get_tree.
  2. Identify the best target element in the tree (label/identifier) and copy its frame coordinate string.
  3. Prefer coordinate-based actions (tap_element / enter_text).
  4. Use the returned tree from the action response to verify the UI changed as expected.
  5. Repeat until complete.
  6. When the task is complete, always capture a screenshot for the user:
    • Prefer get_context and write result.screenshot_base64 to a PNG (or use ./.agents/skills/phoneagent/scripts/rpc.py get-screen-image, which writes PNG files to /tmp/phoneagent-artifacts).
    • Include the PNG path in your final message so the user can open it.

Use swipe to reveal off-screen content, then use the returned tree (or call get_tree if needed). Use one request at a time per server. Do not fire concurrent batches. Split long keyboard input into chunks; do not send giant enter_text payloads in one call.

RPC method reference

All RPC requests are newline-delimited JSON objects with this shape:

json
{"id":1,"method":"<method>","params":{...}}

All success responses look like:

json
{"id":1,"result":{...}}
get_tree
  • Does: Returns the accessibility tree of the currently focused app.
  • Params: none.
  • Returns: {"tree": "<string>"}

Example:

json
{"id":1,"method":"get_tree","params":{}}
get_screen_image
  • Does: Captures the current screen as a base64-encoded PNG plus image dimensions (when available).
  • Params: none.
  • Returns: {"screenshot_base64":"<base64>","metadata":{"width":<number>,"height":<number>}}

Example:

json
{"id":2,"method":"get_screen_image","params":{}}
get_context
  • Does: Convenience method that returns both the current accessibility tree and the current screen image.
  • Params: none.
  • Returns: {"tree":"<string>","screenshot_base64":"<base64>","metadata":{"width":<number>,"height":<number>}}

Example:

json
{"id":3,"method":"get_context","params":{}}
open_app
  • Does: Brings the specified app to the foreground (and makes it the focused app for subsequent calls).
  • Params: bundle_identifier (string, required).
    • iOS: pass bundle identifier (example com.apple.Preferences).
    • Android: pass package name (example com.android.settings).
  • Returns: {"bundle_identifier":"<string>", "tree":"<string>"} (Android also includes package_name).

Example:

json
{"id":4,"method":"open_app","params":{"bundle_identifier":"com.apple.Preferences"}}
tap
  • Does: Taps an absolute point in the current app.
  • Params: x (number, required), y (number, required). Coordinates are in absolute screen points as reported by the tree.
  • Returns: {"tree":"<string>"}

Example:

json
{"id":5,"method":"tap","params":{"x":120,"y":300}}
Show full SKILL.md (311 more words)Show less
tap_element
  • Does: Taps the center of an element using its XCUI frame string from the accessibility tree.
  • Params:
  • coordinate (string, required). Must look like {{x, y}, {w, h}} (copied from the tree).
  • count (integer, optional; default 1). Use 2 for double-tap.
  • longPress (boolean, optional; default false). When true, performs a long-press gesture.
  • Returns: {"coordinate":"<string>", "count":<number>, "longPress":<bool>, "tree":"<string>"}

Example:

json
{"id":6,"method":"tap_element","params":{"coordinate":"{{20.0, 165.0}, {390.0, 90.0}}","count":1,"longPress":false}}
enter_text
  • Does: Taps the center of the target element (to focus it), waits briefly for the keyboard, then types the provided text followed by a newline (Return).
  • Params:
  • coordinate (string, required). Must look like {{x, y}, {w, h}} (copied from the tree).
  • text (string, required).
  • Returns: {"coordinate":"<string>", "tree":"<string>"}

Example:

json
{"id":7,"method":"enter_text","params":{"coordinate":"{{33.0, 861.0}, {364.0, 38.0}}","text":"hello"}}
scroll
  • Does: Scrolls by dragging from a starting point by the provided deltas.
  • Params: x (number, required), y (number, required), distanceX (number, required), distanceY (number, required).
  • Returns: {"tree":"<string>"}

Example:

json
{"id":8,"method":"scroll","params":{"x":215,"y":760,"distanceX":0,"distanceY":-460}}
swipe
  • Does: Swipes in a direction starting from a given point (implemented as a bounded drag gesture).
  • Params: x (number, required), y (number, required), direction (string, required; one of up, down, left, right).
  • Returns: {"tree":"<string>"}

Example:

json
{"id":9,"method":"swipe","params":{"x":215,"y":760,"direction":"up"}}
stop
  • Does: Stops the RPC server test (ends the xcodebuild test session).
  • Params: none.
  • Returns: {}

Example:

json
{"id":10,"method":"stop","params":{}}

iOS app bundle IDs

  • Settings: com.apple.Preferences
  • Camera: com.apple.camera
  • Photos: com.apple.mobileslideshow
  • Messages: com.apple.MobileSMS
  • Home Screen: com.apple.springboard

Android package names

  • Settings: com.android.settings
  • Camera (AOSP): com.android.camera2
  • Photos (Google): com.google.android.apps.photos
  • Messages (Google): com.google.android.apps.messaging
  • Home Screen: launcher package varies by emulator/device

Recovery playbook

  1. If RPC hangs after open_app, restart the test-hosted server and retry with a known-good bundle id.
  2. If taps fail due stale UI, call get_tree again and recalculate target.
  3. If iOS bridge becomes unresponsive, stop/restart xcodebuild test and resume from latest verified app state.
  4. If Android bridge becomes unresponsive, restart adb (adb kill-server && adb start-server), relaunch the bridge, and retry.

End session

  1. Send stop only when the task is complete.
  2. If stop is not sent, terminate the xcodebuild session manually.

© rounak, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts) in .agents/skills/phoneagent of rounak/PhoneAgent.

  • SKILL.md
  • scripts/android_rpc_bridge.py
  • scripts/forward_rpc_localhost.py
  • scripts/rpc.py
  • scripts/start_android_rpc_bridge_local.sh
  • scripts/start_rpc_bridge_local.sh

Open the folder on GitHubat commit 4f0e201

Compare with similar skills

Phoneagent next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Phoneagent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Phoneagent this skillrounak/PhoneAgent798—~2.2kAutomated safety check: PassMIT
Orca iOS Simulator Controlstablyai/orca87k1 repos~584Automated safety check: PassApache-2.0
Apple Crash Log .NET Symbolicationdotnet/skills5.6k1 repos~2.4kAutomated safety check: PassMIT
Mobilerun Docs Referencedroidrun/mobilerun9.6k—~943Automated safety check: PassMIT
App Store Screenshots GeneratorParthJadhav/app-store-screenshots7.2k—~14kAutomated safety check: PassMIT
Apple Higjustinwetch/HIGAgentSkills525—~2.4kAutomated safety check: PassNone

Similar skills

  • iOS Simulator control from inside Orca, with the live device view in Orca's emulator pane. Use when driving a booted Apple Simulator on macOS: taps, gestures…

    87k GitHub starsUsed in 1 repo~584 tokens
    MobileAuto-check passed
  • Official

    Resolves .NET runtime frames in Apple .ips crash logs to function names, source files and line numbers using dSYM symbols, atos and the Microsoft symbol server.

    5.6k GitHub starsUsed in 1 repo~2.4k tokens
    MobileAuto-check passed
  • Mobilerun Docs Reference

    droidrun/mobilerun

    Answers questions about Mobilerun, the LLM-agent framework for automating Android and iOS devices, by pointing the agent to the right page of its v5 documentation.

    9.6k GitHub stars~943 tokensUpdated 3 days ago
    MobileAuto-check passed
  • App Store Screenshots Generator

    ParthJadhav/app-store-screenshots

    Scaffolds a Next.js editor for designing App Store and Google Play screenshots as ads and exporting them at every required size, for iOS, Mac and Android.

    7.2k GitHub stars~14k tokensUpdated yesterday
    MobileAuto-check passed
  • Apple Hig

    justinwetch/HIGAgentSkills

    Apple Human Interface Guidelines reference, updated for iPhone Duo and OS 27.

    525 GitHub stars~2.4k tokensUpdated 9 days ago
    MobileAuto-check passed
  • Simulator Audio E2E

    hyochan/react-native-nitro-sound

    Build and run repeatable react-native-nitro-sound recorder/player regression tests on an iOS Simulator or Android emulator, with explicit virtual-device selection, microphone permission, Maestro…

    961 GitHub stars~1.1k tokensUpdated 9 days ago
    MobileAuto-check passed

Categories

Questions about Phoneagent

What does Phoneagent do?

Control a connected iPhone, iOS simulator, Android emulator, or Android device from macOS through PhoneAgent's JSON-RPC bridge. Phoneagent is an agent skill from rounak/PhoneAgent. Control a connected iPhone, iOS simulator, Android emulator, or Android device from macOS through PhoneAgent's JSON-RPC bridge.

When should I use Phoneagent?

Phoneagent fits situations like: users ask to automate mobile UI actions; inspect accessibility trees; toggle Settings switches; capture screenshots by sending RPC methods like gettree.

How do I install Phoneagent in Claude Code?

Run `npx skills add rounak/PhoneAgent --skill phoneagent -a claude-code`. Or copy the skill folder (.agents/skills/phoneagent in rounak/PhoneAgent) into .claude/skills/phoneagent in your project. Claude Code loads it when a task matches its description.

How do I install Phoneagent in Codex?

Run `npx skills add rounak/PhoneAgent --skill phoneagent -a codex`. Or copy the skill folder (.agents/skills/phoneagent in rounak/PhoneAgent) into .agents/skills/phoneagent in your project. Codex loads it when a task matches its description.

Can I use Phoneagent in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rounak/PhoneAgent --skill phoneagent -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/phoneagent, .gemini/skills/phoneagent, .github/skills/phoneagent and .opencode/skills/phoneagent in your project.

What does Phoneagent need to run?

Going by SKILL.md and its folder, Phoneagent needs Python and a shell for the scripts in its folder and the command-line tools its instructions call (python3, python, xcodebuild, adb, git and xcrun). Our summary lists: Python 3; A Bash shell.

Does Phoneagent access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Phoneagent safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Phoneagent use?

Phoneagent is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Phoneagent use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Phoneagent?

Skills that share tags, products or a category with Phoneagent: Orca iOS Simulator Control (stablyai/orca, 87k stars), Apple Crash Log .NET Symbolication (dotnet/skills, 5.6k stars), Mobilerun Docs Reference (droidrun/mobilerun, 9.6k stars) and App Store Screenshots Generator (ParthJadhav/app-store-screenshots, 7.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Phoneagent?

rounak (a GitHub user) maintains it in rounak/PhoneAgent, which has 798 GitHub stars. The repository was last updated on August 15, 2026.

Source: rounak/PhoneAgent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.