Ios simulator browser

From Xopoko/build-swift-apps · View interactive version

Ios simulator browser is an AI agent skill from the GitHub repository Xopoko/build-swift-apps. Mirror iOS Simulator runs in the Codex browser for interaction, visible proof, and hot-reloaded SwiftUI previews from importable Swift packages; exclude headless or log-only debugging.

How to use this skill

Skill file

iOS Simulator Browser

Before invoking Apple-only binaries, confirm the execution context is macOS. From Windows or Linux, run those steps in a Mac SSH project or through an already configured remote transport; do not retry missing Apple binaries locally.

Bundled commands use $PLUGIN_ROOT ($env:PLUGIN_ROOT in PowerShell; same path suffix) for the plugin root. Set it once: use the host's plugin-root variable when defined (Claude Code: PLUGIN_ROOT="$CLAUDE_PLUGIN_ROOT"), otherwise the absolute path of this plugin's root directory.

Routing Priority

Use this as the preferred user-facing Simulator surface whenever the task would benefit from the user seeing or interacting with the app in the Codex browser. Plain simulator debugging remains useful for build/run, logs, bundle IDs, UI trees, and headless automation; once it provides or launches a Simulator UDID, hand off to this browser workflow for visible proof unless the user explicitly asked for a headless or log-only check.

Browser Workflow

  1. Obtain an explicit Simulator UDID from the existing iOS build/run workflow or from xcrun simctl list devices available.
  2. Start serve-sim in a long-running terminal pinned to that simulator. Clean up any tracked stale helper for this simulator before starting, and install a trap so the helper is cleaned up when this terminal exits:

```bash

SIM="<simulator-udid>"

cleanup_serve_sim() {

npx --yes serve-sim@latest --kill "$SIM" >/dev/null 2>&1 || true

}

trap cleanup_serve_sim EXIT INT TERM HUP

cleanup_serve_sim

npx --yes serve-sim@latest "$SIM"

```

  1. Open the exact local preview URL printed by serve-sim in the Codex in-app browser.
  2. Verify that a real frame is rendering before reporting success. A loaded page alone is not proof that the simulator stream is healthy.

SwiftUI Preview Workflow

Use the bundled launcher when the requested previews live in an importable Swift package. Point it at the package manifest and select the target whose previews should be displayed. It generates a disposable host project outside the user's source tree, installs and launches that host in Simulator, and watches the package for edits.

node "$PLUGIN_ROOT/skills/ios-simulator-browser/scripts/swiftui-preview-browser.mjs" \
  /absolute/path/to/Package.swift \
  --package-target "<target>" \
  --device "<simulator-udid>"

Support Boundary

Proof

For browser or preview QA, capture a browser screenshot showing the simulator frame. For hot reload QA, also report the launcher's hot reloaded package preview ... in pid ... output and show the changed frame after editing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.