kvn8888/OpenFoodJournal / plugins/build-ios-apps/skills/ios-simulator-browser
ios-simulator-browser
VerifiedMirror an iOS Simulator into the Codex in-app browser and render SwiftUI previews from importable Swift packages in that simulator with hot reload. Use when a user wants to watch or interact with an iOS app in the browser, see a SwiftUI preview outside Xcode Canvas, iterate live on a preview, or capture browser-visible simulator proof.
iOS Simulator Browser
Browser Workflow
-
Obtain an explicit Simulator UDID from the existing iOS build/run workflow or from
xcrun simctl list devices available. -
Start
serve-simin 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: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" -
Open the exact local preview URL printed by
serve-simin the Codex in-app browser. -
Verify that a real frame is rendering before reporting success. A loaded page alone is not proof that the simulator stream is healthy.
- Keep the terminal alive while the browser mirror is in use. When finished, stop the terminal and wait for it to exit so the trap runs.
- If the terminal disappeared or did not exit cleanly, run
npx --yes serve-sim@latest --kill "$SIM"before starting another mirror for that simulator. - Never run an unscoped
serve-sim --kill; another thread may own a different simulator mirror.
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 <skill-root>/scripts/swiftui-preview-browser.mjs \
/absolute/path/to/Package.swift \
--package-target "<target>" \
--device "<simulator-udid>"
- Watch mode is enabled by default. On a Swift package source edit, the launcher rebuilds a generated dylib and hot-swaps it into the running host without relaunching the app.
- The generated host shows every preview variant discovered in the selected Swift Package target with in-simulator page controls. To show a subset instead, pass
--preview-filter <regex[, ...]>; it matches display names and code identifiers such asStatusRowView_Previews. - Once the launcher prints the selected Simulator UDID, start
serve-simfor that same UDID and open its printed URL in the in-app browser.
Support Boundary
- Support Swift Package-backed
PreviewProviderand#Previewdeclarations through the generated host. - Do not edit the user's
.xcodeproj,.xcworkspace,Package.swift, schemes, or build settings to force preview support.
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.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |