iphone-cli (iph)

Developer tools

Control any app on a real iPhone (iOS 27+) via accessibility tree. No Xcode or WebDriverAgent.

Your AI app calls the iphone-cli (iph) MCP server, which does the developer tools work and sends the result back to the chat.

About iphone-cli (iph)

iphone-cli (iph) is a community MCP server from HyunSeob, filed in our directory under developer tools. Control any app on a real iPhone (iOS 27+) via accessibility tree. No Xcode or WebDriverAgent.

iphone-cli (iph) is listed in the official MCP registry as io.github.HyunSeob/iphone-cli, version 0.1.10.

At a glance

Publisher
HyunSeob (community)
Runs
See the README for setup
Written in
Rust
License
MIT
GitHub stars
160
Official MCP registry
io.github.HyunSeob/iphone-cli

How to set up iphone-cli (iph)

  1. Follow the install steps in the iphone-cli (iph) README; it is written in Rust, so have that toolchain ready.
  2. Check the iphone-cli (iph) README for keys or settings; the registry lists none that iphone-cli (iph) requires.
  3. Add iphone-cli (iph) to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the iphone-cli (iph) tools to confirm the connection.
  5. Run one read-only task with iphone-cli (iph) first, and keep your app asking before each tool call until the results look right.

iphone-cli (iph) compared with similar servers

  • arr-mcp by bardesss has fewer GitHub stars than iphone-cli (iph) (159 against 160); both are community servers, and both run locally.
  • CometChat Docs by cometchat has fewer GitHub stars than iphone-cli (iph) (160 against 160); both are community servers, and CometChat Docs runs as a remote server and iphone-cli (iph) runs on your own machine.
  • Glance by DebugBase has fewer GitHub stars than iphone-cli (iph) (159 against 160); both are community servers, and both run locally.

Before you connect iphone-cli (iph)

  • Give iphone-cli (iph) its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each iphone-cli (iph) tool call until you trust what it does with them.
  • Treat text that iphone-cli (iph) fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for iphone-cli (iph) on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for iphone-cli (iph)

How marketing and sales teams put iphone-cli (iph) to work, by company size. Pick the size closest to yours and start iphone-cli (iph) on one use case.

Small business

  • A small business with a developer can use iphone-cli (iph) to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask iphone-cli (iph) to explain and fix a marketing site issue without context switching between tools.
  • iphone-cli (iph) runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use iphone-cli (iph) to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect iphone-cli (iph) to keep scripts and automations documented and versioned as they change.
  • Start iphone-cli (iph) on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out iphone-cli (iph) with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on iphone-cli (iph) so web and marketing engineering share one reviewed way of working with AI.
  • iphone-cli (iph) is a community server, so have security review the code and pin a version before iphone-cli (iph) touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

iphone-cli (iph) README

From HyunSeob/iphone-cli on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

iphone-cli (iph)

Let AI agents read and operate any app on a real iPhone, straight from your terminal.

No Xcode. No WebDriverAgent. No app installed on the phone. 100% Rust.

  • Direct Apple developer services, connects over USB or Wi-Fi to the same accessibility and HID services Xcode uses, with no signing or test runner
  • Accessibility tree, not screenshots, reads structured UI elements cleanly, and runs multi-step flows in one call with a built-in QuickJS engine (iph script)
  • Agent-ready, CLI + MCP server (iph mcp) + safety-first outcomes (done / not_sent / unknown)
  • Single native binary (macOS & Windows), no Python, Node.js, or Appium runtime; install one binary and target a real iPhone on iOS 27+

Website · llms.txt · crates.io · 한국어

Built on the principle of Poki (a new implementation from its documented behaviour and device experiments, with no Poki code). Device communication relies on idevice (MIT).

$ iph read --human
Settings  430x932  15 elements
application   "Settings"  @0,0 430x932
  header        "Settings"  @20,119.3 53.7x37
  switch        "Airplane Mode" = "0"  @20,489.3 390x49.3
  button        "Wi-Fi, HomeNet"  @20,538.7 390x49.3
  button        "General"  @20,700 390x49.3
  …

$ iph tap "General"
{"ok":true,"outcome":"done","elapsed_ms":1752,"sent":true,"verified":true,"screen_changed":true,…}

Scope

Host macOS, Windows 10/11 (x64)
Device A real iPhone, iOS 27 or later (verified on one iPhone 15 Pro Max with iOS 27.0.1 only, Korean interface). Touch and text input go through the phone's screen-sharing service (com.apple.coredevice.displayservice, new in iOS 27), so input is not expected to work on iOS 26 or earlier (not tried)
Connection USB or the same LAN (the computer may use Ethernet; verified over USB and Wi-Fi on Windows)
Out of scope Simulators, Android, Linux hosts, landscape

On Windows, doctor, reading, touch and scripts were checked with one iPhone19,4 on iOS 27.2 over USB.

Comparison with alternatives

Capability iphone-cli (iph) iPhone Mirroring + OCR tools Appium / WebDriverAgent mobile-mcp
Native Accessibility Tree Yes (structured JSON) No (screenshots / Vision OCR) Yes Partial (WDA on real iOS)
No Xcode / No code signing Yes Yes No (requires Xcode & signing) No (WDA signing on real iOS)
No app installed on iPhone Yes Yes No (installs WDA runner) No (installs WDA on real iOS)
Windows host support Yes (macOS & Windows) No (macOS 15+ only) Limited (needs macOS to build WDA) Limited on real iOS
Works in the EU Yes (no Mirroring needed) No (Mirroring unavailable) Yes Yes
Unicode / clipboard text input Yes (paste + restore) Simulated keystrokes Yes Varies
Built-in multi-step scripting Yes (embedded QuickJS) External / per-turn calls External SDK Per-turn MCP calls
Safety outcome contract done / not_sent / unknown Varies Standard exceptions Standard tool errors
Target scope Real iPhone, iOS 27+ Real iPhone, iOS 18+ (macOS 15+) Real iOS & Simulators Simulators, Android, WDA iOS
  • Choose iphone-cli (iph) when you want Claude Code, Codex, or another AI agent to operate a real iPhone (iOS 27+) via the accessibility tree without Xcode or WebDriverAgent, including on Windows or in the EU.
  • Choose an iPhone Mirroring + OCR tool if your phone runs iOS 18–26 on macOS 15+ outside the EU.
  • Choose Appium / WebDriverAgent or mobile-mcp if you need iOS Simulators, Android, or iOS 26 and earlier with an element tree.

Install

Neither Rust nor Xcode is needed. On a Mac it is one line in Terminal (it uses only tools macOS ships: curl, tar, shasum).

curl -fsSL https://raw.githubusercontent.com/HyunSeob/iphone-cli/main/install.sh | sh
iph setup                     # walks through what the phone needs

It downloads the universal binary (Apple silicon and Intel) from the latest release, checks its checksum and puts it at ~/.local/bin/iph. IPH_INSTALL_DIR picks another folder and IPH_VERSION=v0.1.0 a specific version. On Windows, download iph-windows-x86_64.zip from the releases and put iph.exe in a folder on your PATH.

  • Mac: plug the phone in and tap Trust on it; that pairs it.
  • Windows: Apple's device service must be installed: the Apple Devices app from the Microsoft Store, or just the service with winget install Apple.AppleMobileDeviceSupport. Then plug the phone in and tap Trust.
  • Developer disk image: when the phone lacks it, iph doctor installs it. It uses Xcode's copy when the Mac has one, and otherwise fetches one once from the public doronz88/DeveloperDiskImage repository (about 18 MB, pinned commit and SHA-256). The iph repository contains no Apple files.

With Rust 1.93 or later, the crate on crates.io installs the same iph (building it takes a few minutes; on Windows it needs Visual Studio Build Tools (C++)):

cargo install iphone-cli      # ~/.cargo/bin/iph

Or from a checkout:

git clone https://github.com/HyunSeob/iphone-cli
cd iphone-cli
cargo install --path .        # ~/.cargo/bin/iph

First-time setup

iph setup runs iph doctor, says in one line what to do on the phone for each failed check, and checks again. An agent can read checks[].user_action from iph doctor (JSON) and guide the user.

Check Required What it is
pairing yes The Mac holds a pairing record for the phone. If not: connect by USB and tap Trust
connection yes The phone is visible over USB or the same Wi-Fi
developer_mode yes Settings → Privacy & Security → Developer Mode. If it is off, iph doctor makes that switch appear
developer_disk_image yes Source of the accessibility, display and input services. When missing, iph doctor fetches and installs it (see Install)
screen_unlocked yes The phone is unlocked. Only lockdown's word decides a lock
settings_in_front yes Settings comes to the front (fails when something covers it). When the screen cannot be read, accessibility_tree fails instead
accessibility_tree yes Screen elements can really be read
touch_input yes Scrolls the Settings list down one step and back to see that touch lands (--no-touch-test skips it)
wifi recommended Wireless lockdown flags and the phone's usbmuxd Network entry (see below)
auto_lock recommended Auto-Lock → Never for long sessions
do_not_disturb info Shown only while Do Not Disturb from iph dnd on is still on

Setup requirements and how to interpret the checks are in docs/onboarding.md (Korean).

Wi-Fi setup and troubleshooting

Pair by USB first, then keep the iPhone unlocked on the same LAN. The computer may use Ethernet. To enable wireless connections, run this while USB is attached:

iph doctor --fix-wifi

If the phone is still not discovered, register its IP below. Wireless setup details (Korean).

Notification banners take taps near the top of the screen. Banners cover the top of the screen and are not part of the accessibility tree. A tap near the top then lands on the banner and opens another app (this happened once during development). For long unattended work turn Do Not Disturb on with iph dnd on, and put it back with iph dnd off afterwards. Details: Do Not Disturb below.

Direct IP when automatic discovery fails

For a USB-trusted phone missing from discovery, use the IP shown in Settings → Wi-Fi → the network's info button:

iph devices                                      # while USB is attached: note the UDID
iph --udid <UDID> connect --ip <iPhone-IP>         # after unplugging USB
iph --udid <UDID> read

The Apple device service is still required. CLI, MCP and scripts share the saved address for the selected UDID; register it again if the IP changes. Connection details (Korean).

Commands

Every command prints JSON; add --human for people. The device is chosen by --udid, then IPH_UDID, then udid in ~/.config/iph/config.toml, then the only connected phone. With several phones and none chosen, you get an error with the list.

Command Does
iph connect --ip <IP> Verify and save the selected paired phone's IP
iph devices Connected phones, iOS version, connection, readiness
iph setup / iph doctor Preparation and checks
iph read [--app] [--all] [--full] [--raw] [--max-age ms] Elements on screen. --all includes off-screen ones, --full adds identifiers (about 0.5 s more), --raw attaches every numbered attribute
iph find <selector> Elements matching a selector
iph tap <selector | x,y> [--long ms] [--double] Tap the middle of an element, or a point
iph swipe <up|down|left|right | x1,y1,x2,y2> [--duration ms] [--drag] Swipe. --drag slows to a stop before lifting, so nothing coasts
iph pinch [in|out] [--scale F] [--rotate DEG] [--at selector | x,y] [--duration ms] Two fingers. out spreads them (zoom in, scale 2), in pinches them (zoom out, scale 0.5); --scale takes 0.25 to 4, --rotate degrees (clockwise is positive). They meet in the middle of the screen or at --at. screen_changed: false is a fair answer on a screen that does not zoom
iph scroll <up|down> [--until selector] [--max N] One step, or until an element shows
iph type <text> [--clear] [--submit] Paste text into the field that has the keyboard (any language, emoji). The clipboard is put back and the field's value checked
iph key <key> return, esc, tab, cmd+a …
iph button <home|lock|volume_up|volume_down> Hardware buttons
iph launch <bundle id | name> [--restart] [--env K=V]… [-- <arguments>…] / iph apps Launch an app, list apps. --env sets environment variables and what follows -- goes to the app as launch arguments (iph launch com.example.app --env TZ=UTC -- -AppleLanguages "(ko)"). Either one restarts a running app, since only a new process takes them; the result says restart_implied, with the arguments and the variable names (never their values)
iph screenshot [-o file] PNG capture
iph record <start|stop|status> [-o file.mp4] [--display N] Record the screen to an MP4 file while other commands run
iph batch <file | -> A JSON array of steps in one call
iph script <file | -> [--arg k=v] Run JavaScript as given (- reads stdin)
iph run <name> [--arg k=v] / iph scripts Run a saved script, list saved scripts
iph mcp [--tools a,b] MCP server on stdio
iph dnd <on|off|status> Turn Do Not Disturb on, put the earlier Focus back, or show the current state
iph syslog <start|read|stop|status> [--app app] [--process name] [--pid N] [--level L] [--after SEQ] [--grep RE] [--max N] [-o file] Capture the phone's log in memory while other commands run; read returns what is new without stopping it, stop can return the latest matching entries. See Phone log
iph stop Stop the resident process for this phone
Selectors
  • A plain string is an exact label: iph tap "General"
  • label="exact", label~="contains", label/regex/
  • role=button (application, button, switch, text_field, search_field, key, tab, header, text, image, link, adjustable, other)
  • id=… matches the accessibility identifier or the element id from iph read; id~= and id/regex/ work too
  • value="…", value~=…
  • within="<selector>" only inside that element, index=N the Nth match (from 0)
  • Several matches are an ambiguous_selector error with the candidates; nothing is picked for you

Rows labelled "name, value" (as in Settings: "Wi-Fi, HomeNet") also match label="Wi-Fi".

Scripts, MCP and batch also take an object: {label, label_contains, label_regex, value, value_contains, value_regex, role, id, id_contains, id_regex, within, index}.

Results
{"ok": true, "outcome": "done", "elapsed_ms": 1752, "sent": true, "verified": true, "screen_changed": true, "element": {…}}
{"ok": false, "outcome": "not_sent", "error": {"code": "not_found", "message": "…", "hint": "…"}, "elapsed_ms": 1210, "screen_summary": {…}}
outcome Meaning Exit code
done Ran to the end. With ok: false: everything was done, but what was looked for is not there (below) 0, 1 with ok: false
not_sent Nothing reached the phone. Safe to try again 1
unknown Input may have reached the phone. Do not resend; read the screen 2

The exit code is 0 only with ok: true. batch, script and run follow the same table (1 when nothing went out). The one ok: false with outcome: "done" is scroll --until that did not find its target: the scrolls did go out, so it is not not_sent; the result has error.code: "not_found", found: false, exit code 1. Trying again is safe, but the screen has moved by those scrolls.

The phone does not acknowledge touch reports. So results separate sent from verified (the screen was read again afterwards), and taps, typing and scrolls report screen_changed. When another app came to the front, app_changed: true is added.

For type, ok: true / outcome: "done" means the command completed, and sent: true means the input keys were sent. verified: true keeps its meaning of reading the field's value afterwards; it does not prove the intended text was entered. Apps can format, mask, correct or clear pasted text, so no exact match with the requested text is required.

type result Observation
value_before, value The original field's value before input and after input, before Return. "" is a readable empty string; null means unavailable. Whitespace in values is preserved. A different focused field is never substituted.
value_changed true / false when both values were read; null when they could not be compared.
screen_changed Actual comparison of the accessibility trees before input and after restoring the on-screen keyboard (and after Return, if sent). null when the final screen could not be read. A field change and a screen change are separate observations, and this does not compare screenshot pixels.
warning {code, message, hint} when the effect needs inspection: value_unchanged, value_unreadable, value_change_unknown, value_empty (nonempty input but empty result), or clear_not_observed. Without --submit, these warnings preserve ok: true / outcome: "done".
submit_sent true when Return was sent, false when not requested or withheld; null if sending Return failed and it may have gone out.

An unchanged value may mean paste was blocked, but can also come from masking, app behavior or replacing text with identical text using --clear. Check with iph read or a screenshot; do not automatically retype. If paste appears blocked, check Settings → Apps → the target app → Paste from Other Apps → Allow. The observation does not establish that permission was denied.

--submit withholds Return whenever there is a warning, returning ok: false, outcome: "unknown", error.code: "type_not_verified", submit_sent: false (exit code 2). The paste/clear keys have already gone out. This also stops scripts and batches, including scripts that catch the error. Inspect before deciding to submit separately with iph key return; re-running type could duplicate input. This intentionally also holds an identical replacement with --clear --submit. Clear-only (iph type "" --clear) may submit when the field is observed empty, even if it was empty already. CLI, MCP and script calls share these fields; batch keeps them in each type step, and --human shows observations and warnings.

Configuration

# ~/.config/iph/config.toml
udid = "00008130-…"

[dnd]
# focus = "Work"         # a Focus for iph dnd on to switch to instead of Do Not Disturb, by the name the phone shows
# control = "Focus"      # label of the Focus control in Control Center, for a phone not in Korean or English

[daemon]
input_idle_secs = 120    # close the input session after this long unused; 0 closes it after every command
idle_exit_secs = 1800    # the resident process exits after this long without requests
screen_video = false     # also take the screen video while sending input. Touches do not need it, and over Wi-Fi it clogs the tunnel
restart_accessibility = true  # when the phone's accessibility daemon stops answering or answers only with empty readings, end it so the phone starts a new one (takes about 20 s)
record_max_secs = 1800   # `iph record` ends a recording after this long (up to 1.4 GB at the phone's 6 Mbit/s)

[script]
timeout_secs = 300       # how long one script may run (840 at most)
memory_mb = 64           # how much memory a script may hold

Sending input needs the phone to be in "screen sharing" state (an indicator shows at the top of the phone). iph sets that up with the audio stream alone and does not take the screen video (screen_video). For an app that hides its content or warns while the screen is shared, set input_idle_secs = 0: the phone is then in that state only while input is being sent, at the price of 3 to 4 s more per input. Reading does not depend on screen sharing.

iph does not judge what it presses. Pay, send and order buttons are pressed like any other, and input goes to whatever app is in front. What to press is up to the caller.

Do Not Disturb
  • On and off: iph dnd on turns Do Not Disturb on, iph dnd off puts back the Focus that was on before. iph never switches it by itself.
  • Put back to what: at on the Focus that was on (or none) is written to ~/Library/Application Support/iph/<udid>.dnd.json, and off restores it as it was. If the phone was already in Do Not Disturb, iph leaves it alone; if a person switched to another Focus meanwhile, that one stays. The record outlives the resident process.
  • How: no service on the phone offers this, so iph does what a person does: pull Control Center down, hold the Focus control, pick the mode in the list, press Home twice. Control Center is therefore visible for a moment, and one switch usually takes 11 to 15 s, or 19 to 36 s when the resident process has just started.
  • Needs: the Focus control on Control Center's first page, and Control Center opening while an app is in front. For a phone in a language other than Korean or English, put the names the phone shows in control and focus under [dnd].
  • Not covered: whatever comes through Do Not Disturb (alarms and timers, emergency alerts, people and apps allowed in the Do Not Disturb settings) and system pop-ups. Whether banners really stay away while Do Not Disturb is on was not tested separately (it relies on how iOS behaves).
Phone log

iph syslog start collects what the phone logs, in a buffer inside the resident process, while taps, reads and scripts go on as usual. iph syslog read returns what arrived since the last read without stopping the capture, so a test or an agent can check what an app logged after each tap. No sudo log collect on the Mac is needed.

iph syslog start --app com.apple.Preferences # an app by bundle id or name, as `iph launch` takes it
iph launch com.apple.Preferences --restart
iph tap "Battery"
iph syslog read --grep "battery"              # what was logged since start; the result has "cursor": 12
iph tap "General"
iph syslog read --after 12 --grep "general"   # only what is newer than the last read
iph syslog stop                               # or: stop --grep "general" --max 20
  • The buffer: kept entries go into a ring buffer in memory, at most 100,000 entries and 64 MiB (--buffer-entries, --buffer-mb); the oldest are dropped first. Each entry gets a seq: 1 for the first of a capture, one more for each after it. Nothing is written to disk unless you ask with -o. The buffer lives in the resident process, so it goes with the capture when iph stop ends it, a newer build replaces it, or it exits after its idle time. status shows how full it is under buffer (entries, bytes, oldest_seq, newest_seq, evicted).
  • read: returns the entries newer than --after SEQ whose message matches --grep (a regular expression), oldest first, at most --max (50 by default, at most 1000). Each message is cut to 500 characters (message_cut; -o keeps the whole message). Without --after it starts at the oldest entry the buffer still holds. The result has entries, count, cursor, more, dropped and state, and ended_reason once the capture has ended.
    • cursor: pass it as the next --after. It is the last entry returned when --max cut the page short, and the newest seq when the whole buffer was looked through, even if nothing matched. So a loop never reads an entry twice and never skips one that is still in the buffer. A cursor belongs to the capture that gave it: seqs start again at 1 with each capture, so after a new start read without --after.
    • more: true when --max cut the page short and another matching entry is already waiting.
    • dropped: entries newer than --after that were pushed out of the buffer before this read. Anything but 0 means entries were lost; read more often or filter.
    • A capture that ended (a dropped connection) can still be read until you stop it.
  • The file (optional): -o <file> also writes every kept entry to a JSON Lines file with its whole message, readable by you only: a {"event": "start", …} line, one line per entry (seq, time (UTC), pid, process, sender, level, subsystem, category, message) and a final {"event": "end", "reason": …} line. A file without an end line was cut off by a killed resident process. At --max-mb MiB (1 to 4096, 64 by default; it needs -o) the file moves to <file>.1, replacing the previous one (the start line goes with it). Starting again empties the file once the phone has started sending; a start that fails leaves it as it was.
  • Filters: --app keeps the entries of an app, named by bundle id or display name the way iph launch takes it (repeatable). iph looks up where the app is installed and keeps an entry when its executable lies in that bundle, so the app's extensions count too and the filter keeps matching across restarts of the app. An app that is not installed (or a name that fits two) fails before anything starts. --process keeps entries by executable name, exactly (repeatable); Settings is Preferences. With both, an entry is kept if it is from any listed app or any listed process. --level drops anything below debug, info, notice, error or fault, whichever of those selected it. --pid makes the phone send only that process's entries, so it narrows what --app and --process can match.
  • Volume: unfiltered over Wi-Fi it is a lot. In one 60 s idle run the phone sent about 4,800 entries/s, 1.4 MB/s. At that rate the default buffer holds about 20 s (100,000 entries), so read often or filter with --process for anything longer. An entry of about 290 B as JSON weighs about 430 B in memory, so a full default buffer takes about 41 MiB; the 64 MiB limit applies when messages run long.
  • Cost to other commands: in one run over Wi-Fi (an iPhone 16 Pro, the first tap after starting iph: 6 taps without a capture, 4 with an unfiltered capture receiving 2,900 to 9,900 entries/s, 3 with --pid), the capture did not slow taps: the medians were 10.0, 10.1 and 9.7 s. Every tap over 6 s, with a capture or without, waited for one screen reading the phone did not answer, which iph asks again after 6.5 s. The resident process used at most 12% of one core. The volume itself costs reads: with the phone locked, a read took 2.3 s at 9,000 unfiltered entries/s against 1.0 s without a capture, so over Wi-Fi use --pid when reads must stay quick (--app and --process filter on the computer, after the entries have crossed the network).
  • stop: returns seen (entries the phone sent), kept (put in the buffer), buffer and why it ended, and with -o also rotations and path. With --grep or --max it also returns matched, the number of entries in the buffer that matched, and entries, the latest --max of them, oldest first (50 by default, at most 1000, cut like read's). The buffer is gone after stop, so read what you need first.
  • What ends a capture: stop, a dropped connection, iph rebuilding its connections (after a command times out or the phone stops answering), iph stop, a newer build of iph replacing the resident process, or the resident process exiting after its idle time (a capture does not keep it alive). The end line (with -o) and status say which. A capture is not restarted by itself, so a gap in the log is never hidden. One capture runs at a time: a second start fails with capture_running, or with capture_ended while an ended capture waits to be read; stop it first.
  • After a dropped connection the phone sends nothing to the next capture for about 20 to 30 s. status and read say so in a hint while nothing has arrived.
  • Private values: values an app marks private in its log calls arrive as <private>, as in Console. In one app's launch, about a fifth of its entries carried one.
  • Also in scripts as syslog(action, opts) and over MCP as iph_syslog. A script cannot write a file. Not in batch: a capture outlives the call that started it.

Recordings

Visual evidence for a test run, made by iph itself: no ffmpeg is needed.

Recording. iph record start -o run.mp4 starts writing the screen to an MP4 (HEVC, as the phone sends it), and iph record stop ends it and returns {path, duration_s, frames, keyframes, lost_packets, bytes, width, height}, with first_loss_s and a packets_lost warning when packets were lost. iph record status shows the state. Taps, swipes and reads keep working while it runs (tap latency was the same with and without a recording). One recording at a time: a second start fails with recording_running and a stop with nothing running with no_recording, and neither changes anything.

  • How: the recorder opens a screen-sharing session of its own with the phone, the video of one display, next to the input session's audio, so the phone shows its screen-sharing indicator. Each session stops only its own streams: input sessions open, close and retry as usual while a recording runs, and stop leaves the input session alone.
  • Use USB. The phone sends one keyframe, at the start, and never another, so a lost packet damages the picture from there to the end of the file. Players still open such a file. When packets were lost, the result has lost_packets above 0, first_loss_s (seconds into the file where the damage starts) and a warning with code packets_lost; the result stays ok. On an iPhone 16 Pro over Wi-Fi, 2 of 9 short recordings lost packets (9 and 51). Over USB no packet was lost in the runs measured.
  • Still screens: the phone sends few frames or none while nothing moves. The last frame then lasts until stop, so the file is as long as the recording.
  • Which display: without --display, displays 1, 0 and 2 are tried and the first whose video has the shape of the screen being read is kept: its width and height in pixels must match the points of iph read to within 1%, else display_mismatch. A display whose video does not start (record_failed) is passed over too, and the displays are tried for at most 45 s, after which start fails with start_timeout. On an iPhone Duo folded, displays 0 and 1 both show the cover screen and display 2 sends nothing. On a phone with two displays, start instead records the display in use, by the number the phone gives it (1 the cover, 2 the inner display), and its video must match that display's panel; when iph cannot tell which display is in use, start fails with display_unknown. The inner display sends its frames the way its panel lies, upright (1408x2016) even when the screen is in landscape, so width and height are the panel's, and the file's track matrix turns them as the display was turned when the recording started: players show it the way the screen looked. Turning the phone during a recording is not followed.
  • The file: frames go to <file>.part as they come, and stop adds the index and renames it. If the resident process stops (iph stop), the file is completed too. If it is killed, only <file>.part is left, without the index; the stream it left running on the phone is stopped within seconds after the next command connects to the phone. So is the video of a start that was cut off, or of a recording that ended because the connection was reset; a stream still left when the resident process exits is stopped on its way out. Streams another client started, such as Xcode's screen view, are left alone.
  • Ending on its own: a recording also ends, and its file is completed with what came, when the connection to the phone is closed, or reset after a connection error, an accessibility service that would not open, or a command that ran out of time (not when only the accessibility connection or the input session is made again), when the phone stops sending the video (none for 2.5 s, and the phone no longer lists the stream or did not answer three checks in a row), when the phone changes the video's parameter sets, or after record_max_secs ([daemon] in config.toml, default 1800: at the phone's cap of 6 Mbit/s, 30 minutes is up to 1.4 GB). The reason is in ended_reason. stop returns that report, or else the next start does, under previous. The resident process does not exit for being idle while it records, nor for its idle time after a recording ended with nobody told.
  • Scripts: a recording a script started and did not stop ends with the script, also when the script throws, and the script's result has its report under recording.
  • Measured on an iPhone Duo (iOS 27.2.1, folded, USB): 1408x2048, 50 to 52 fps while the screen moves, about 0.5 Mbit/s.

Read the rest of the iphone-cli (iph) README on GitHub

Questions about iphone-cli (iph)

What is the iphone-cli (iph) MCP server?

Control any app on a real iPhone (iOS 27+) via accessibility tree. No Xcode or WebDriverAgent. iphone-cli (iph) is maintained by HyunSeob on GitHub at HyunSeob/iphone-cli, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the iphone-cli (iph) MCP server?

iphone-cli (iph) doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (HyunSeob/iphone-cli). Like most servers, iphone-cli (iph) ends with a command or URL you paste into your AI app's MCP config.

Does iphone-cli (iph) need an API key?

The registry lists no required keys for iphone-cli (iph). Check the iphone-cli (iph) README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is iphone-cli (iph) an official MCP server?

No. iphone-cli (iph) is a community server maintained by HyunSeob. Community servers can be excellent; read the code and the open issues before you give iphone-cli (iph) access to company data.

What license is iphone-cli (iph) under?

iphone-cli (iph) is released under the MIT license, according to its GitHub repository. The license covers the code of iphone-cli (iph); the service it connects to has its own terms.