Skip to main content

ios-simulator-browser

Mirror iOS Simulator and hot-reload SwiftUI previews in the Codex browser.

소스 정보

저장소
bronc-x/lotus
최근 소스 활동
2026년 9월 14일 05:31
감지된 SKILL.md 언어
영어
스타
23
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
7 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
ios-simulator-browser
description
Mirror iOS Simulator and hot-reload SwiftUI previews in the Codex browser.
# iOS Simulator Browser Mac ## 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 only a tracked stale helper owned by this task 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 npx --yes serve-sim@latest "$SIM" ``` 3. Open the exact local preview URL printed by `serve-sim` in the Codex in-app browser. 4. 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, verify ownership before running `npx --yes serve-sim@latest --kill "$SIM"`; reuse a healthy existing mirror instead of stopping another task's helper. - 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. ```bash 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 as `StatusRowView_Previews`. - Once the launcher prints the selected Simulator UDID, start `serve-sim` for that same UDID and open its printed URL in the in-app browser. ## Support Boundary - Support Swift Package-backed `PreviewProvider` and `#Preview` declarations 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.
GitHub에서 보기