<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: HyunSeob</title>
    <description>The latest articles on DEV Community by HyunSeob (@hyunseob).</description>
    <link>https://dev.to/hyunseob</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4253675%2F78a56b7b-136a-45ed-a323-d215c89997e7.png</url>
      <title>DEV Community: HyunSeob</title>
      <link>https://dev.to/hyunseob</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hyunseob"/>
    <language>en</language>
    <item>
      <title>How to control a real iPhone with Claude Code or Codex</title>
      <dc:creator>HyunSeob</dc:creator>
      <pubDate>Thu, 19 Nov 2026 12:09:13 +0000</pubDate>
      <link>https://dev.to/hyunseob/how-to-control-a-real-iphone-with-claude-code-or-codex-43eb</link>
      <guid>https://dev.to/hyunseob/how-to-control-a-real-iphone-with-claude-code-or-codex-43eb</guid>
      <description>&lt;p&gt;I wanted Claude Code to open Settings on my iPhone and tap General by name.&lt;/p&gt;

&lt;p&gt;On a real iPhone, the usual options each come with a catch. Appium with WebDriverAgent gives you an element tree, but you need a signed WDA runner on the phone (typically built with Xcode; on Windows, Appium needs a preinstalled or externally managed WDA). Tools built on macOS iPhone Mirroring skip WDA, but require macOS 15+ on Apple silicon or T2, aren't available in the EU, and depend on screenshots or OCR instead of Apple's accessibility tree.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://github.com/HyunSeob/iphone-cli" rel="noopener noreferrer"&gt;iphone-cli (&lt;code&gt;iph&lt;/code&gt;)&lt;/a&gt;&lt;/strong&gt; in Rust: a single binary that works as both a CLI and a stdio MCP server on macOS and Windows. It reads Apple's accessibility tree and drives apps on a real iPhone over USB or Wi-Fi, without Xcode or any runner app installed on the phone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1yfr137gyzkiodd48kv3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1yfr137gyzkiodd48kv3.gif" alt="A terminal sends iph tap &amp;quot;7&amp;quot; and the iPhone Calculator displays 7." width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick start
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;iph&lt;/code&gt; targets real iPhones running &lt;strong&gt;iOS 27 or later&lt;/strong&gt;. Plug the phone in over USB, unlock it, and tap &lt;strong&gt;Trust&lt;/strong&gt; before running setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install &lt;code&gt;iph&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;macOS (Apple silicon &amp;amp; Intel universal binary):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsSL https://raw.githubusercontent.com/HyunSeob/iphone-cli/main/install.sh &lt;span class="o"&gt;|&lt;/span&gt; sh
iph setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installer verifies the checksum and puts &lt;code&gt;iph&lt;/code&gt; in &lt;code&gt;~/.local/bin&lt;/code&gt; (and prints the &lt;code&gt;PATH&lt;/code&gt; line if needed). Release binaries for macOS are ad-hoc signed in CI, and you don't need to sign or install a runner app on the phone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Windows 10/11 (x64):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pair over USB first. After that, the Windows PC can stay on Ethernet as long as the iPhone is on the same LAN.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Apple's device service: either the &lt;strong&gt;Apple Devices&lt;/strong&gt; app from the Microsoft Store or &lt;code&gt;winget install Apple.AppleMobileDeviceSupport&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Download &lt;code&gt;iph-windows-x86_64.zip&lt;/code&gt; from &lt;a href="https://github.com/HyunSeob/iphone-cli/releases" rel="noopener noreferrer"&gt;GitHub Releases&lt;/a&gt;, extract &lt;code&gt;iph.exe&lt;/code&gt;, and add its folder to your &lt;code&gt;PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Plug in the phone, tap &lt;strong&gt;Trust&lt;/strong&gt;, and run &lt;code&gt;iph setup&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Build from source with stable Rust:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo install iphone-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Windows builds need Visual Studio C++ Build Tools.)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Run first-time setup
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;iph setup&lt;/code&gt; runs &lt;code&gt;iph doctor&lt;/code&gt;, walks through any failed checks, and lets you press Enter to re-check in an interactive terminal. It verifies pairing, Developer Mode (you toggle it on the phone and reboot), the Developer Disk Image, screen lock, accessibility reading, and touch input. For the touch check, it brings Settings to the front and scrolls one step and back.&lt;/p&gt;

&lt;p&gt;If developer services are missing, &lt;code&gt;iph doctor&lt;/code&gt; prefers Xcode's copy of the Developer Disk Image and also checks its cached download, fetching and SHA-256-verifying it if needed. My test phone already had the image mounted, so I haven't verified the auto-download path on a clean device yet.&lt;/p&gt;

&lt;p&gt;Once USB works, run &lt;code&gt;iph doctor --fix-wifi&lt;/code&gt; while the cable is still plugged in to enable Wi-Fi, or register the phone's IP directly with &lt;code&gt;iph --udid &amp;lt;UDID&amp;gt; connect --ip &amp;lt;IP&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Connect Claude Code or Codex
&lt;/h3&gt;

&lt;p&gt;Register the built-in stdio MCP server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add iph -- iph mcp
codex mcp add iph -- iph mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;iphone-cli&lt;/code&gt; is also on the Official MCP Registry as &lt;code&gt;io.github.HyunSeob/iphone-cli&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To test the whole path regardless of your phone's language, ask your agent:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use &lt;code&gt;iph_read&lt;/code&gt; to tell me which app is open and name three controls on screen.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you'd rather have agents invoke the &lt;code&gt;iph&lt;/code&gt; CLI directly in the shell instead of MCP, clone the repo on macOS/Unix and symlink the bundled skill (&lt;code&gt;skills/iph/SKILL.md&lt;/code&gt; isn't included in the standalone release archive):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ln -s &lt;span class="s2"&gt;"$PWD/skills/iph"&lt;/span&gt; ~/.claude/skills/iph   &lt;span class="c"&gt;# Claude Code&lt;/span&gt;
ln -s &lt;span class="s2"&gt;"$PWD/skills/iph"&lt;/span&gt; ~/.agents/skills/iph   &lt;span class="c"&gt;# Codex&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a trimmed terminal session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;$ iph &lt;span class="nb"&gt;read&lt;/span&gt; --human
Settings  430x932  15 elements
application   &lt;span class="s2"&gt;"Settings"&lt;/span&gt;  @0,0 430x932
  header        &lt;span class="s2"&gt;"Settings"&lt;/span&gt;  @20,119.3 53.7x37
  switch        &lt;span class="s2"&gt;"Airplane Mode"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt;  @20,489.3 390x49.3
  button        &lt;span class="s2"&gt;"Wi-Fi, HomeNet"&lt;/span&gt;  @20,538.7 390x49.3
  button        &lt;span class="s2"&gt;"General"&lt;/span&gt;  @20,700 390x49.3

$ iph find &lt;span class="s1"&gt;'role=button label~="General"'&lt;/span&gt;
$ iph tap &lt;span class="s2"&gt;"General"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How it works under the hood
&lt;/h2&gt;

&lt;p&gt;Screen reads and input from the CLI and MCP share a per-device daemon (&lt;code&gt;iph daemon&lt;/code&gt;), started on demand over a Unix socket on macOS or a named pipe on Windows and exiting after 30 minutes of idle time by default. Local commands like &lt;code&gt;iph scripts&lt;/code&gt; or MCP &lt;code&gt;tools/list&lt;/code&gt; never spawn it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iph (CLI) ─┐
iph mcp  ──┼─ unix socket / named pipe ─ iph daemon ─ lockdown → CoreDeviceProxy → userspace TCP → RSD
           ┘                                           ├ com.apple.accessibility.axAuditDaemon.remoteAXService
                                                       ├ displayservice + hid.universalhidservice  (touch, keyboard)
                                                       ├ pasteboardservice                         (clipboard / text)
                                                       ├ appservice                                (launch, app list)
                                                       └ screencaptureservice                      (PNG screenshots)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(All services above except &lt;code&gt;axAuditDaemon.remoteAXService&lt;/code&gt; live under &lt;code&gt;com.apple.coredevice.&lt;/code&gt;.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Because the tunnel runs a userspace TCP stack inside the daemon, &lt;code&gt;iph&lt;/code&gt; needs no root privileges and creates no host TUN interface.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reading the UI tree
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;com.apple.accessibility.axAuditDaemon.remoteAXService&lt;/code&gt; speaks DTX and sends back two nested binary plists (&lt;code&gt;bplist00&lt;/code&gt;) encoded with &lt;code&gt;NSKeyedArchiver&lt;/code&gt;. Unpacking &lt;code&gt;resultData.treeDump&lt;/code&gt; gives visible elements with their roles, states (&lt;code&gt;enabled&lt;/code&gt;, &lt;code&gt;selected&lt;/code&gt;, and &lt;code&gt;focused&lt;/code&gt; from &lt;code&gt;IS_EDITING&lt;/code&gt;), and optional &lt;code&gt;label&lt;/code&gt;, &lt;code&gt;value&lt;/code&gt;, &lt;code&gt;hint&lt;/code&gt;, &lt;code&gt;frame&lt;/code&gt;, and &lt;code&gt;identifier&lt;/code&gt; fields. &lt;code&gt;--full&lt;/code&gt; waits for the extra pass that populates identifiers, and &lt;code&gt;--raw&lt;/code&gt; dumps every numbered attribute.&lt;/p&gt;

&lt;p&gt;Because the agent gets structured labels and coordinates instead of pixels, it can target controls by name without burning vision tokens on a screenshot every turn.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why a tap opens an audio stream
&lt;/h3&gt;

&lt;p&gt;Reading the tree needs no media session. Sending synthetic HID touch or keyboard events through &lt;code&gt;hid.universalhidservice&lt;/code&gt; does: iOS ignores them unless the phone has an active screen-sharing session via &lt;code&gt;com.apple.coredevice.displayservice&lt;/code&gt; (you'll see the screen-sharing indicator on the phone while input is active).&lt;/p&gt;

&lt;p&gt;Streaming full screen video over Wi-Fi just to tap a button clogs the tunnel. By default (&lt;code&gt;screen_video = false&lt;/code&gt;), &lt;code&gt;iph&lt;/code&gt; opens the media session with an &lt;strong&gt;audio stream only&lt;/strong&gt; and drops the incoming packets. If starting audio fails with error &lt;code&gt;9022&lt;/code&gt; (during a call or screen recording, for example), it falls back to video. Touch coordinates are normalized to &lt;code&gt;0..=65535&lt;/code&gt; per axis, and multi-touch gestures like &lt;code&gt;iph pinch&lt;/code&gt; pack two fingers into a single HID report with independent axis scaling so circles don't stretch on tall screens.&lt;/p&gt;

&lt;p&gt;For non-ASCII text, Korean, and emoji, &lt;code&gt;iph type&lt;/code&gt; locates the single editing field, attaches a temporary HID keyboard, and pastes through &lt;code&gt;pasteboardservice&lt;/code&gt; (&lt;code&gt;⌘V&lt;/code&gt;, preceded by &lt;code&gt;⌘A&lt;/code&gt; and delete when &lt;code&gt;--clear&lt;/code&gt; is set). It then reads the field back and restores supported clipboard contents in parallel.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Credits: I built &lt;code&gt;iph&lt;/code&gt; from the documented behavior of &lt;a href="https://github.com/JosssphZhou/poki" rel="noopener noreferrer"&gt;Poki&lt;/a&gt; and direct device experiments, without using Poki's code. Device communication uses &lt;a href="https://github.com/jkcoxson/idevice" rel="noopener noreferrer"&gt;idevice&lt;/a&gt; (MIT, with media-session setup adapted from an &lt;code&gt;idevice&lt;/code&gt; example), and the tunnel embeds a modified &lt;code&gt;jktcp&lt;/code&gt; 0.1.8 TCP stack (MIT).&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How an agent tells whether a tap landed
&lt;/h2&gt;

&lt;p&gt;After &lt;code&gt;iph&lt;/code&gt; sends a tap, iOS never confirms that the button actually fired. Writing HID bytes only proves packets left the host; the phone might have dropped the tap mid-animation or switched apps right before it arrived. Retrying blindly on a checkout button can double-submit an order.&lt;/p&gt;

&lt;p&gt;So every action reports an explicit &lt;code&gt;outcome&lt;/code&gt; field:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;outcome&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;CLI exit code&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;done&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Command finished (or &lt;code&gt;scroll --until&lt;/code&gt; stopped without finding the target, with &lt;code&gt;ok: false&lt;/code&gt; and &lt;code&gt;found: false&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt; (&lt;code&gt;1&lt;/code&gt; when &lt;code&gt;ok: false&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;not_sent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;That failing step did not send input to the phone&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;unknown&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Input may have reached the phone. Read the screen before trying again&lt;/td&gt;
&lt;td&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The exit codes above apply to JSON-returning CLI commands (CLI argument parsing errors can also exit with &lt;code&gt;2&lt;/code&gt;, and MCP tool calls return the same JSON without exit codes).&lt;/p&gt;

&lt;p&gt;Before retrying a batch, check which steps already ran:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On a single &lt;code&gt;iph tap&lt;/code&gt; where the selector wasn't found, &lt;code&gt;not_sent&lt;/code&gt; means nothing left the host, so retrying is safe.&lt;/li&gt;
&lt;li&gt;On &lt;code&gt;iph batch&lt;/code&gt;, a later step can fail with &lt;code&gt;not_sent&lt;/code&gt; even though earlier steps already sent input. Same with &lt;code&gt;scroll --until&lt;/code&gt;, which can return &lt;code&gt;not_sent&lt;/code&gt; with a positive &lt;code&gt;scrolls&lt;/code&gt; count if multiple matches show up after scrolling.&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;iph script&lt;/code&gt;, if a later error stops the script after it has sent input, the script reports &lt;code&gt;unknown&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Responses also separate &lt;code&gt;sent&lt;/code&gt;, &lt;code&gt;verified&lt;/code&gt;, and &lt;code&gt;screen_changed&lt;/code&gt;. A tap whose post-tap screen read fails can still return &lt;code&gt;done&lt;/code&gt; with &lt;code&gt;sent: true&lt;/code&gt;, &lt;code&gt;verified: false&lt;/code&gt;, and &lt;code&gt;screen_changed: false&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hard stop on &lt;code&gt;unknown&lt;/code&gt;:&lt;/strong&gt; An &lt;code&gt;unknown&lt;/code&gt; result terminates the running script immediately, even inside &lt;code&gt;try/catch&lt;/code&gt;, so a script can't blindly keep tapping after an ambiguous failure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cautious &lt;code&gt;type --submit&lt;/code&gt;:&lt;/strong&gt; &lt;code&gt;verified: true&lt;/code&gt; on &lt;code&gt;iph type&lt;/code&gt; only means the original field was read back, not that the app kept your exact string (apps mask passwords, reformat numbers, or clear fields). If &lt;code&gt;iph type&lt;/code&gt; reports a warning, &lt;code&gt;--submit&lt;/code&gt; skips Return and exits with &lt;code&gt;outcome: "unknown"&lt;/code&gt; (&lt;code&gt;type_not_verified&lt;/code&gt;, &lt;code&gt;submit_sent: false&lt;/code&gt;, exit &lt;code&gt;2&lt;/code&gt;). Without &lt;code&gt;--submit&lt;/code&gt;, those warnings keep &lt;code&gt;ok: true&lt;/code&gt; and &lt;code&gt;outcome: "done"&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Multi-step flows in one call (QuickJS)
&lt;/h2&gt;

&lt;p&gt;When you already know the sequence of taps, burning one MCP round trip per tap is slow. &lt;code&gt;iph&lt;/code&gt; embeds a sandboxed QuickJS runtime with no host filesystem, network, or process access (timeout and memory default to 300 s and 64 MiB, both configurable).&lt;/p&gt;

&lt;p&gt;Save this as &lt;code&gt;flow.js&lt;/code&gt; and run &lt;code&gt;iph script flow.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"com.apple.Preferences"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;scroll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"down"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;until&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"General"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;tap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"General"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;tap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"About"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;ios_version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;readField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"iOS Version"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;take&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"value"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also save reusable flows under &lt;code&gt;~/.config/iph/scripts/&lt;/code&gt; on macOS or &lt;code&gt;%APPDATA%\iph\scripts\&lt;/code&gt; on Windows and run them with &lt;code&gt;iph run &amp;lt;name&amp;gt;&lt;/code&gt;. (The built-in &lt;code&gt;settings-version&lt;/code&gt; example was written against my Korean phone, using &lt;code&gt;일반&lt;/code&gt; → &lt;code&gt;정보&lt;/code&gt; → &lt;code&gt;iOS 버전&lt;/code&gt;, so on an English phone use a script like &lt;code&gt;flow.js&lt;/code&gt; above.)&lt;/p&gt;

&lt;p&gt;Inside scripts, selector-based &lt;code&gt;tap()&lt;/code&gt; waits up to 5 seconds for the element and checks whether its frame has settled before tapping (if it's still moving once checks run out, it attempts the tap anyway). &lt;code&gt;launch()&lt;/code&gt; waits until the target app's PID is in front and re-checks before later input, &lt;code&gt;readField&lt;/code&gt;, or &lt;code&gt;readList&lt;/code&gt; calls. For scrolling lists, &lt;code&gt;readList()&lt;/code&gt; looks for two overlapping rows across scroll steps and reports why it stopped, or reports &lt;code&gt;list_uncertain&lt;/code&gt; if it can't line up the rows during its final end-of-list check. The full script API is in the &lt;a href="https://github.com/HyunSeob/iphone-cli#scripts" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it compares
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;iphone-cli&lt;/code&gt; (&lt;code&gt;iph&lt;/code&gt;)&lt;/th&gt;
&lt;th&gt;iPhone Mirroring + OCR tools&lt;/th&gt;
&lt;th&gt;Appium / WebDriverAgent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Supported hosts&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;macOS, Windows 10/11 (x64)&lt;/td&gt;
&lt;td&gt;macOS 15+ (Apple silicon / T2; unavailable in EU)&lt;/td&gt;
&lt;td&gt;macOS (Windows is limited; needs a preinstalled or externally managed WDA)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Runner app on device&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;None (iOS 27+)&lt;/td&gt;
&lt;td&gt;None (iOS 18+)&lt;/td&gt;
&lt;td&gt;Signed WDA runner installed on phone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;How UI is read&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Native accessibility tree (JSON)&lt;/td&gt;
&lt;td&gt;Screenshots / OCR&lt;/td&gt;
&lt;td&gt;Native accessibility tree via WDA&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use &lt;code&gt;iph&lt;/code&gt; if you want an agent on macOS or Windows (including in the EU, since it doesn't touch iPhone Mirroring) to read an iOS 27+ iPhone's accessibility tree without WDA. For iOS simulators or older iPhones, Appium can read the tree through WDA; for Android, it uses a driver such as UiAutomator2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-world timings
&lt;/h2&gt;

&lt;p&gt;Measured on 2026-11-11 on my iPhone 15 Pro Max (&lt;code&gt;iPhone16,2&lt;/code&gt;, iOS 27.0.1) over Wi-Fi with the daemon already connected:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;iph read&lt;/code&gt; (Settings home, 10 runs): &lt;strong&gt;median 1.35 s&lt;/strong&gt;, max 2.10 s&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;iph tap&lt;/code&gt; with verification (20 runs, 0 observed misses): &lt;strong&gt;median 1.75 s&lt;/strong&gt;, max 4.30 s&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;iph scroll&lt;/code&gt; (one step with verification): &lt;strong&gt;2.1–2.6 s&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;iph type&lt;/code&gt; (Notes, with verification and clipboard restore): &lt;strong&gt;4–7 s&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On a still screen on this phone, iOS itself waited about &lt;strong&gt;1.1 s&lt;/strong&gt; after receiving a dump request before sending the tree back, which sets the floor for read latency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Limits and caveats
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;iOS version:&lt;/strong&gt; Targets iOS 27 and later because the input path relies on &lt;code&gt;com.apple.coredevice.displayservice&lt;/code&gt;. Earlier versions haven't been tested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verified hardware so far:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;macOS (USB &amp;amp; Wi-Fi): Korean iPhone 15 Pro Max (&lt;code&gt;iPhone16,2&lt;/code&gt;), iOS 27.0.1&lt;/li&gt;
&lt;li&gt;Windows (USB): &lt;code&gt;iPhone19,4&lt;/code&gt;, iOS 27.2&lt;/li&gt;
&lt;li&gt;Windows on wired LAN + iPhone on Wi-Fi: &lt;code&gt;iPhone14,2&lt;/code&gt;, iOS 27.2.1 (direct IP registration)&lt;/li&gt;
&lt;li&gt;Other iOS builds may shift internal accessibility attribute numbers (check with &lt;code&gt;iph read --raw&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Out of scope:&lt;/strong&gt; Simulators, Android, Linux hosts, and landscape orientation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Device lock:&lt;/strong&gt; Unlock the phone first; Face ID and passcode prompts still happen on the device.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notification banners:&lt;/strong&gt; Banners sit outside the app's accessibility tree and can catch taps near the top of the screen. &lt;code&gt;iph dnd on&lt;/code&gt; / &lt;code&gt;iph dnd off&lt;/code&gt; toggles Do Not Disturb via Control Center (see the &lt;a href="https://github.com/HyunSeob/iphone-cli#do-not-disturb" rel="noopener noreferrer"&gt;README&lt;/a&gt; for Focus prerequisites and caveats).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rich clipboard content:&lt;/strong&gt; When I tested copying formatted text inside Notes, reading it over the remote pasteboard stalled for about a minute. &lt;code&gt;iph type&lt;/code&gt; now skips reading app-provided rich formats, tries to clear its own pasted text afterwards (reporting &lt;code&gt;clipboard_restored: false&lt;/code&gt;), and leaves anything you copied in the meantime alone.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it out
&lt;/h2&gt;

&lt;p&gt;If you run this on Windows or another iPhone model, I'd love to hear which model, iOS version, and connection (USB or Wi-Fi) you used.&lt;/p&gt;

&lt;p&gt;If something breaks, &lt;code&gt;iph diagnose&lt;/code&gt; writes a local report without pairing records or private keys. Check the file before posting it in a public issue, since it still includes device identifiers, network addresses, and logs (plus command arguments and output if you run &lt;code&gt;iph diagnose -- &amp;lt;cmd&amp;gt;&lt;/code&gt;).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/HyunSeob/iphone-cli" rel="noopener noreferrer"&gt;https://github.com/HyunSeob/iphone-cli&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Website &amp;amp; Docs:&lt;/strong&gt; &lt;a href="https://hyunseob.github.io/iphone-cli/" rel="noopener noreferrer"&gt;https://hyunseob.github.io/iphone-cli/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;crates.io:&lt;/strong&gt; &lt;a href="https://crates.io/crates/iphone-cli" rel="noopener noreferrer"&gt;https://crates.io/crates/iphone-cli&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Official MCP Registry:&lt;/strong&gt; &lt;code&gt;io.github.HyunSeob/iphone-cli&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ios</category>
      <category>mcp</category>
      <category>rust</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
