Skip to main content
Back

Open-Source iPhone Use Lets OpenAI's Codex Control a Physical iPhone

A new open-source Codex plugin bridges OpenAI's coding agent to a physical iPhone over USB, letting it drive real apps like WeChat, Taobao, and Meituan.

Pro

Repo, Full Access
  • iPhone Use connects OpenAI Codex to a real iPhone over USB via an MCP plugin
  • Built on Appium's WebDriverAgent, pinned to commit 16.14.0, running fully on local loopback
  • Exposes 17 tools: taps, swipes, Unicode input, batched actions, scroll-find, list collection
  • Falls back to screenshot plus coordinate tapping when accessibility targeting fails
  • Requires macOS, full Xcode, Apple developer account, Python 3.9+, Node 20.19+
  • MIT licensed, 870+ stars; demos include WeChat, Taobao, Meituan, Xiaohongshu automation

A developer has released iPhone Use, an open-source package that connects OpenAI’s Codex agent to a physical iPhone through USB. The repository passed 870 GitHub stars shortly after launch, while the author’s demo showed Codex scrolling WeChat Moments, navigating Taobao ordering flows, and summarizing group chats on the device.

The project targets mobile workflows that lack practical web equivalents, including Chinese super-apps such as WeChat, Taobao, Meituan, and Xiaohongshu. It gives Codex access to those apps through Apple’s existing UI-testing infrastructure, with no jailbreak or cloud-hosted device required.

WDA provides the hands

WebDriverAgent, commonly called WDA, executes taps, swipes, button presses, and text input through Apple’s XCTest framework. Appium has long used WDA for iOS automation; iPhone Use packages it behind a Model Context Protocol server so Codex can invoke device actions as tools.

The bundled Python service communicates with WDA through local loopback forwarding on port 18100. Remote addresses are rejected, and runtime data, downloaded dependencies, signing credentials, and builds remain on the Mac according to the project documentation.

Seventeen tools cover the control loop

The MCP server exposes 17 tools to Codex, with two additional tools reserved for the live screen widget. Representative tools cover observation, interaction, text entry, efficient multi-step work, and environment checks.

Purpose Tools What they provide
Observe pua_observe, pua_find Control trees, screenshots, and target queries
Interact pua_tap, pua_swipe, pua_press_button Touch gestures and hardware-button actions
Enter text pua_type_text, pua_wait Unicode input and bounded waits
Reduce tool calls pua_batch, pua_scroll_find, pua_collect_list Grouped actions, scrolling searches, and list extraction
Check readiness pua_doctor, pua_setup, pua_ready Diagnostics, configuration, and connection checks

The observation format reduces model latency and token use by removing duplicate fields from control trees and skipping XML generation when a screenshot is sufficient. Batch execution, scrolling search, and list collection also compress workflows that would otherwise require repeated model calls.

Pixels fill gaps in the accessibility tree

Accessibility-based targeting can fail when an app omits labels, overlaps controls, or renders custom interfaces that expose little useful structure. When iPhone Use cannot locate an element, it returns a screenshot and guidance that lets the model select the target visually.

The fallback converts image coordinates into iOS point coordinates using image.pixel_to_point, then passes the result to pua_tap. This conversion accounts for the difference between screenshot pixels and the logical coordinate system used for iPhone input.

The install has sharp edges

A working installation depends on Apple’s development and code-signing stack, so the host and device must meet several requirements.

Requirement Details
Host macOS with the full Xcode application installed
Signing An Apple developer account and a development team ID for WDA Runner
Device A USB-connected iPhone with Developer Mode enabled
Python Version 3.9 or later
Node.js Version 20.19 or later
WDA A project-pinned commit from version 16.14.0

The setup flow can use Codex to clone the repository, run sh scripts/install.sh, detect the connected phone, sign WDA with the developer’s team ID, build the runner, and wait for pua_ready to report success. Pinning WDA gives the project a tested baseline while avoiding unexpected changes from upstream releases.

Apple account authentication, device trust prompts, unlocking, and biometric checks still require physical interaction. Those steps keep the initial installation from becoming a fully unattended process.

App coverage comes with operational limits

The author reports stable operation across WeChat, Taobao, Meituan, and Xiaohongshu, all of which use frequently changing interfaces and extensive custom UI components. Independent compatibility will depend on each app version, the available accessibility metadata, and the model’s ability to interpret screenshots.

  • Text entry and submission use separate actions, allowing workflows to confirm recipients, amounts, and final values before committing.
  • Passwords, verification codes, and Face ID remain under user control, and the live preview can be paused during handoff.
  • Timeouts and disconnects may leave an action in an uncertain state, so the agent must observe the current screen before retrying.
  • Task speed depends on the app, USB connection, WDA state, observation size, and model response time.

Loopback-only communication reduces network exposure, but WDA remains a powerful control channel for an unlocked phone. The Mac, signing identity, MCP process, and model session therefore share the project’s trust boundary, making repository review and confirmation steps especially relevant for purchases, messages, and account changes.

A reusable bridge for mobile agents

Browser and desktop agents usually have direct access to a document tree, operating-system APIs, or established automation protocols. Stock iPhones expose a narrower route: a signed XCTest runner can inspect and operate the interface under Apple’s development controls.

iPhone Use turns that route into an agent-friendly stack by combining WDA, a compact MCP tool surface, local transport, batched operations, and visual fallback. The same architecture can support QA pipelines, accessibility testing, app regression checks, and personal automation where browser-based agents cannot reach the underlying workflow.

The repository uses the MIT license, allowing teams to fork the implementation, adapt its tools, and integrate the bridge into their own testing or agent systems.