serve-sim CLI
The npx serve-sim command streams an iOS Simulator to the browser and lets an agent tap, swipe, type and replace the camera feed
- 2,905 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- Captures the simulator screen and serves it as a web stream; over a network or tunnel others can see it
- Sends the simulator taps, text and buttons, and permission commands change an app's access to camera, photos and notifications
- Camera replacement injects a library into the app process via DYLD_INSERT_LIBRARIES, and `repair-input` restarts SpringBoard
Install
- Works in
Manual install
npx serve-simNo installation needed: the command starts the preview on port 3200. Needs macOS, Xcode command line tools and Node.js 20 or newer.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Captures the simulator screen and serves it as a web stream; over a network or tunnel others can see it
- Sends the simulator taps, text and buttons, and permission commands change an app's access to camera, photos and notifications
- Camera replacement injects a library into the app process via DYLD_INSERT_LIBRARIES, and `repair-input` restarts SpringBoard
This is third-party code. Review the repository files before installing.
What it does
serve-sim starts a small Swift helper that captures simulator frames through `simctl io` and streams them to the browser, with a React preview interface on top. Gestures, buttons, rotation and text input travel the same channel, so the simulator can be driven from another machine or through a tunnel. For agents the repository includes a skill: it describes the JSON shape for gestures, suggests an order of actions and lists pitfalls. Separate commands replace the camera feed for a chosen app with a file, a video or a webcam, toggle CoreAnimation debug options, simulate a memory warning and grant permissions to an app. iPhone, iPad and Apple Watch are supported, and iPhone Duo has a `fold` command.
Who it is for. For mobile developers on macOS who want Claude Code, Codex or Cursor to control an iOS Simulator and watch it from a browser.
Good fit when
- An agent built the app and you ask it to press buttons, swipe and walk a scenario in a running simulator
- You need to show the simulator to a colleague or client by link: start `npx serve-sim` and expose the address through a tunnel
- The app needs a camera frame for a test: `serve-sim camera <bundle-id> --file photo.png` substitutes an image or video with no real device
- You are checking interface performance: the `ca-debug` command turns on debug layers such as offscreen or blended
- You develop with Expo or another dev server and want to embed the simulator preview in it through `serve-sim/middleware`
Not a fit when
- You use an Android emulator: that is `adb` territory, and serve-sim works only with Apple simulators
- You need to build the app or install it into the simulator: `xcodebuild` and `xcrun simctl install` do that
- Your Mac is Intel: the helper binary is built for Apple Silicon only
- You need a React Native debugger with Redux state and network: serve-sim shows the screen, not the app's internals
Example request
Start serve-sim, tap the "Sign in" button in the simulator and take a screenshot of the screen after loginLimitations
It works only on macOS with Xcode command line tools and Node.js 20 or newer. The helper binary is built for Apple Silicon and will not run on Intel. Camera replacement needs macOS 14 or newer. In Xcode 27 input requires Device Hub to be running with the simulator window frontmost, and the terminal may need Accessibility access. The `repair-input` command restarts SpringBoard and closes running apps. iPhone Duo support relies on private beta APIs and a model from Xcode, which must be rechecked after SDK updates.
How to disable. Stop streams with `serve-sim --kill` and close the preview tab. Delete the skill from the agent's skills directory and the plugin entry through `/plugin` in Claude Code. Helper state lives in `$TMPDIR/serve-sim/`, and camera replacement is lifted with `serve-sim camera --stop-webcam` and restarting the app.
FAQ
How do I start serve-sim?
Run `npx serve-sim`: it finds a booted simulator and opens the preview at http://localhost:3200. A specific device can be named, for example `serve-sim "iPhone 16 Pro"`. The `--detach` flag starts a background mode and `--list` shows running streams.
How do I install the serve-sim skill in Claude Code?
Run `bunx add-skill EvanBacon/serve-sim` or, in Claude Code, `/plugin marketplace add EvanBacon/serve-sim`. The skill teaches the agent commands for gestures, buttons, rotation, camera and permissions. The README names Grok, Claude Code, Cursor, Codex CLI and Gemini CLI as compatible.
Can I watch the simulator from another computer?
Yes, the simulator is served over the local network or through a tunnel to a remote Mac, and viewers use it as if it were local. The author suggests testing the hosting locally first and only then exposing the address.
How do I replace the camera in an app?
Run `serve-sim camera com.acme.MyApp` with the app's bundle identifier. By default an animated placeholder plays, `--file` substitutes an image or video and `--webcam` takes the Mac's live camera. The source changes on the fly with `camera switch`. Requires macOS 14 or newer.
What if input into the simulator stops working?
In Xcode 27, Device Hub may have disconnected the legacy touch and keyboard services. Run `serve-sim repair-input -d <udid>`, then restart serve-sim and reopen the app. Note that the command restarts SpringBoard and closes running apps.
Discussion
No questions or reviews yet.
Related
CLI toolsA DeepSeek Harness plugin: iOS Simulator and a USB iPhone inside the chat, with 22 tools to drive them
A skill with scripts for building iOS apps and driving the simulator through the accessibility tree, with compact output for agents
An MCP server for the iOS Simulator: taps, swipes, text input, accessibility tree, screenshots, video and app control
A skill that teaches an agent to drive iOS Simulators, Android Emulators and USB phones through the simvyn command line tool
Gives an agent control of iOS simulators, Android emulators, TVs and Electron apps: taps, flows, profiling and React Native debugging
An MCP server that takes plain-language commands and drives the iOS Simulator through idb: apps, taps, logs
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| serve-sim (this entry) | no | 2,905 | ||
| iOS Simulator Skill | no | 1,302 | a skill with scripts for building and driving the simulator through the accessibility tree, while serve-sim streams live video to the browser | |
| iOS Simulator MCP Server | no | not required | 2,201 | an MCP server with taps, swipes and screenshots, while serve-sim works as a CLI and offers streaming video |
| DSH iOS Simulator | no | 351 | a DeepSeek Harness plugin |
README in short
The README presents serve-sim as the `npx serve` of Apple Simulators and shows the launch command right away. It lists the features: a browser stream, gestures, log forwarding, dragging files into the simulator and support for Watch, iPad and iOS. Then come requirements, Xcode 27 specifics, an iPhone Duo section on folding and a command reference. Separate sections explain camera replacement, connecting through `.claude/launch.json` for Claude Code Desktop, Expo integration and middleware embedded into a dev server with proxying for remote viewers. A diagram of how it works and the Apache-2.0 license finish it.
README badge
Original SKILL.md
--- name: serve-sim description: Control and stream a running iOS, iPad, or Apple Watch Simulator with npx serve-sim. Use for simulator preview, taps, gestures, hardware buttons, rotation, camera injection, permissions, accessibility, and CoreAnimation debug. license: Apache-2.0 --- # serve-sim Drive an Apple Simulator (iOS, iPad, Apple Watch) from an agent using the [serve-sim](https://github.com/EvanBacon/serve-sim) CLI. serve-sim spawns a Swift helper that captures the simulator framebuffer via `simctl io`, exposes it as an MJPEG stream plus a binary WebSocket input channel, and serves a React preview UI on top. This skill teaches an agent the exact CLI surface, the gesture JSON shape, the gotchas, and the recommended workflows. ## When to use - The user wants an agent to **tap, swipe, drag, pinch, or send hardware buttons** to a running Apple Simulator. - The user wants to **stream a simulator** to a browser (local, LAN, or tunneled) for review or remote control. - The user wants to **inject a synthetic camera feed** (file, webcam, or animated placeholder) into a specific app on the simulator. - The user wants to **toggle CoreAnimation debug overlays** (off-screen rendering, blended layers, slow animations) for performance work. - The user wants to **simulate a memory warning** or **rotate the device** programmatically. - The user wants to **read the simulator's accessibility tree** to find UI elements without pixel hunting. - The user wants to **grant, revoke, or reset an app's privacy permissions** — camera, photos, location, contacts, or **push notifications**. ## When NOT to use - Android emulators → use `adb shell` tooling. - Building or installing an iOS app → use `xcodebuild` or `xcrun simctl install`. - React Native in-app runtime debugging (Redux state, network inspection, component tree) → use rn-debugger tooling. - Real iOS hardware devices → use `xcrun devicectl` or Xcode. ## Prerequisites Before any other action, verify the host satisfies these. If something is missing, tell the user exactly what to install — do not proceed. | Requirement | Check command | Why | |---|---|---| | macOS host | `uname -s` returns `Darwin` | serve-sim only runs on macOS | | Xcode CLI tools | `xcrun --version` exits 0 | `simctl` is the underlying simulator driver | | Node.js ≥18 | `node --version` ≥18 | serve-sim is an npm package run via `npx` | | macOS 14+ (optional) | `sw_vers -productVersion` ≥14 | Required ONLY for `camera` subcommand | A bundled helper script is available: `scripts/check-prereqs.sh`. Run it; if it exits non-zero, surface the message to the user. A booted simulator is required for most subcommands. Check with `xcrun simctl list devices booted`. If none are booted, tell the user to open Xcode → Simulator or to run `xcrun simctl boot <UDID>`. ## Mental model ```text ┌──────────────┐ simctl io ┌─────────────────┐ MJPEG / WS ┌─────────┐