Skip to content

fix(emulator): take serve-sim 0.1.47 so the iOS simulator works on Xcode 27 - #24228

Merged
Jinwoo-H merged 3 commits into
mainfrom
jinwoo/serve-sim-0.1.47
Oct 1, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
jinwoo/serve-sim-0.1.47

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​180 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​159
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​96 $\color{#cf222e}{\Huge{\mathbf{−}}}$​62 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34

ELI5

On Macs with Xcode 27, Orca's iOS simulator pane never starts: the helper program Orca bundles looks for an Apple framework in the folder Xcode 26 used, and Xcode 27 moved it. The fix is to take the newer version of that helper (serve-sim 0.1.47), which looks in both places, and teach Orca to recognise the new helper's running process. The new helper also needs a networking library (ws) that the copy Orca makes for installed apps didn't include, so Orca now gives that copy its dependencies too.

What Changed

Before (Xcode 27): opening the iOS emulator failed immediately with dyld: Library not loaded: @rpath/SimulatorKit.framework … tried: '/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/SimulatorKit.framework/…' (no such file).
After: the simulator streams, and tap, typing, the home button, and the accessibility tree all work.

Mechanism:

  • serve-sim goes from 0.1.40 to 0.1.47. In 0.1.40, bin/serve-sim-bin was a separate program that hard-linked SimulatorKit at the Xcode 26 path. In 0.1.47 that program is gone. A native Node addon (dist/native/serve-sim-native.node) replaces it and also tries Xcode 27's SharedFrameworks location. 0.1.46 also fixes an Xcode 27 display-selection problem that could hang boot (upstream fix(serve-sim): restore Xcode 27 Device Hub streaming and input EvanBacon/serve-sim#140).
  • Helper process detection (serve-sim-helper-processes.ts): Orca checks that a helper process is really running for the device before it attaches, and it kills leftover helpers. It found helpers by the name serve-sim-bin, which no longer exists. Without this change every new session would be judged "no helper", killed, and reported as "stream endpoint is not reachable". The 0.1.47 helper runs as <Orca/Electron> …/serve-sim.js <udid> --port N --host 127.0.0.1 --exit-on-simulator-shutdown, and Orca now matches that shape too. It still matches the old serve-sim-bin shape, so a helper started by the previous Orca version (still running after an app update) is found and killed. One-shot commands such as serve-sim.js tap … or --detach are deliberately not matched.
  • Executable bits: the old chmod steps are removed rather than repointed. They covered the materialized runtime copy, the dev node_modules fallback, and the packaging afterPack step. serve-sim publishes its helpers as 755 (0.1.40 did too), and every copy step keeps that mode, so they were never needed. Evidence: tar tvzf of the 0.1.47 tarball shows 755 on all four helpers, and the installed node_modules files are 755. A fs.cpSync of the extracted package keeps 755. In the shipped Orca.app, serve-sim.js is 755 although nothing ever chmodded it.
  • Materialized runtime dependencies (serve-sim-runtime-materializer.ts): on macOS, packaged Orca copies serve-sim from Contents/Resources/node_modules/serve-sim to <userData>/serve-sim-runtime/<version>/, removes quarantine there, and runs it from that copy ([Bug]: macOS 1.4.106: nested simcam dylib is unnotarized and syspolicyd reports Malware rejection #6877). In 0.1.40 the entry imported nothing from npm. In 0.1.47 dist/serve-sim.js imports ws, and the bare copy had no node_modules, so in packaged builds every attach failed with ERR_MODULE_NOT_FOUND: Cannot find package 'ws' imported from …/serve-sim-runtime/<ver>/dist/serve-sim.js. Dev builds hid this because they run serve-sim straight from pnpm's node_modules.
    • The copy is now laid out as <version>/node_modules/serve-sim. Each name in the package's own dependencies gets a link at <version>/node_modules/<name> pointing to the bundle's installed sibling (ws, inspect-webkit, sonner), and names the bundle lacks are skipped. The links point into the signed bundle rather than copying it, so each dependency's own dependencies keep resolving from there.
    • Quarantine is cleared on the copied package before the links are made, so the recursive xattr never walks into the bundle.
    • The runtime is reused only when the new-layout entry exists and every link resolves to the current bundle. A same-version runtime in the old flat layout, or one whose links dangle because the app moved or was translocated, is rebuilt.
  • The lockfile diff covers only serve-sim and its new dependencies (sonner, and ws 8.21.3, which Orca already ships). The packaged runtime closure is computed from dependencies, so it picks them up without a hand edit.

Out of scope: 0.1.47 also adds a Device Hub input warning and a serve-sim repair-input command. Orca-side detection and repair for that is a separate follow-up.

Why

Linking the bundle's dependencies keeps the runtime copy small and lets Node resolve each dependency's own dependencies from the bundle. Copying them would mean computing the transitive closure by hand. Running serve-sim from the bundle instead of a copy would bring back the Gatekeeper rejection of the camera dylib (#6877).

Upstream already fixed the Xcode 27 relocation and boot issues, so taking the release is less risky than patching the old binary's rpath or shipping our own SimulatorKit lookup. Matching the helper by the --exit-on-simulator-shutdown flag plus the serve-sim entry path is how serve-sim itself launches --detach helpers. That separates long-lived helpers from short one-shot CLI calls for the same device.

Linked Issue

Fixes #11388
Fixes #17587

Visual Proof

N/A for screenshots: the pane UI did not change. The before/after is the dyld failure versus a working stream, and the live run below shows it.

Testing

Live in the real Orca app, on macOS 27 / Xcode 27.0 (27A266a) / Apple silicon. Each run used a throwaway iOS 26.5 simulator, an isolated profile, and a background launch. Simulator.app never opened. Every input was checked against simctl io screenshot and the AX tree.

  • Dev app (node_modules path): emulator devices lists the simulator, and emulator attach starts …/node_modules/serve-sim/dist/serve-sim.js <udid> --port 3100 --host 127.0.0.1 --exit-on-simulator-shutdown.
    • tap on the Settings search field plus type Orca puts "Orca" in the field (AX shows "No Results for “Orca”"). button home returns to SpringBoard, and a 4-point gesture swipe moves to home page 2. kill removes the helper and closes the port.
    • Opening the emulator tab in the renderer streams live, and keystrokes typed into the pane reach the simulator (Spotlight showed "Notes").
  • Packaged app (arm64 electron-builder --dir, hardened runtime, signed with an Apple Development identity, driven by the bundled orca CLI):
    • Before this fix, attach failed with the ws ERR_MODULE_NOT_FOUND above.
    • After: the helper runs as Orca.app/Contents/MacOS/Orca <profile>/serve-sim-runtime/1.4.214/node_modules/serve-sim/dist/serve-sim.js <udid> …, with ws, inspect-webkit and sonner linked into the bundle. Tap+type, home, swipe, AX and kill all behave as in dev.
    • A relaunch reuses the runtime: the copy's mtime is unchanged and attach still works.
    • vmmap of the helper shows serve-sim-native.node (from the materialized copy) and Xcode's SharedFrameworks/SimulatorKit loaded in the hardened-runtime process. codesign -dv shows flags=0x10000(runtime) and the same TeamIdentifier on both the app and the addon, and the entitlements have no disable-library-validation. So library validation accepts the re-signed addon and Apple's SimulatorKit.
  • Earlier standalone checks: serve-sim 0.1.40 --detach reproduces the [Bug]: iOS Emulator doesn't work on macos 27 #11388 dyld error. 0.1.47 run Electron-as-node, plus IosEmulatorBackend under a stubbed electron, started, drove and stopped helpers cleanly.

Automated:

  • pnpm test src/main/emulator: 31 files / 235 tests pass.

    • New materializer cases cover dependency links (absent ones skipped), clearing quarantine before linking, rebuilding an old-layout runtime, and rebuilding when links dangle after the app moves.
    • One regression case copies the real installed serve-sim in the packaged layout. A child node process then runs import.meta.resolve on every declared dependency from inside the copied dist/. On the previous materializer it fails with ERR_MODULE_NOT_FOUND; with the fix it passes.
    • Earlier cases cover the node-hosted helper shape, skipping one-shot commands, and the legacy serve-sim-bin match.
  • config/scripts/electron-builder-*.test.mjs: 78 pass.

  • pnpm tc:node, oxlint, oxfmt, and pnpm run check:code-quality:changed all pass.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Not verified yet

  • Xcode 26 host: only Xcode 27 is installed here. 0.1.47 still tries the old PrivateFrameworks path first, but I didn't exercise it.
  • Intel Macs: the addon and helpers are universal (x86_64 + arm64) but untested on Intel.
  • Developer ID signing, notarization, and Gatekeeper on a quarantined download: these can't be run locally. The packaged run above used an Apple Development identity with hardened runtime and was not quarantined, so App Translocation is covered only by the dangling-link unit test.
  • Pane input in the packaged app: this was exercised only in the dev app.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Cross-platform: the iOS emulator is macOS-only. All changes are behind the existing darwin checks, or are no-ops when files are absent.
  • SSH: no change; the emulator runs on the local host.
  • Backwards compatibility: the legacy helper shape is still matched and killed after an update.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…ode 27

serve-sim 0.1.40's helper binary hard-linked SimulatorKit at its pre-Xcode 27
path, so every iOS emulator start failed with a dyld error on Xcode 27.
0.1.47 replaces that binary with a napi addon that finds SimulatorKit in
either location, and runs the stream helper as a node process.

Match the new helper process (serve-sim.js ... --exit-on-simulator-shutdown)
while still matching legacy serve-sim-bin helpers left by an older Orca, and
mark the package's new standalone helpers executable.
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 3/5

[High risk] Updates iOS simulator helper to new version with build-time changes.

The PR is not ready to merge because orphan cleanup can terminate an unrelated simulator helper and the new dependency test can fail on a permitted install.

Findings

  1. P1 Unrelated simulator helper terminated ▶
  2. P1 Test requires omitted dependency ▶
  3. P2 Concurrent runtime copy removed ▶
  4. P2 Signed addon load untested ▶
  5. P2 Package helper check removed ▶

Summary

The PR upgrades serve-sim for Xcode 27, updates detached-helper detection, and changes runtime materialization to link bundled dependencies. The new orphan match can stop an independently launched helper, an added dependency test fails when a permitted dependency is absent, and concurrent materialization can remove a copy another instance is using.

Reviews (3) · Last reviewed commit: "fix(emulator): give the materialized ser..."

Comment thread package.json
"qrcode": "^1.5.4",
"react-i18next": "17.0.15",
"serve-sim": "0.1.40",
"serve-sim": "0.1.47",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Signed addon load untested

This upgrade moves SimulatorKit loading into a native addon inside Orca's Electron process, but the added tests check only file presence and executable bits. If a signed, hardened-runtime build rejects the addon, the simulator will remain broken in the release even though these tests pass. Please add a signed-build load check for this new path; a previous serve-sim packaging change passed local unpack validation but failed during the macOS release.

Knowledge Base Used: Restore macOS Serve-Sim Release Packaging

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — the serve-sim 0.1.40 → 0.1.47 bump and the Orca-side changes that make the new helper layout and process shape work.

  • serve-sim 0.1.47 — takes the release whose native addon looks up SimulatorKit's Xcode 26 and 27 locations, fixing the dyld failure in #11388/#17587; also picks up the upstream Xcode 27 boot-hang fix.
  • Helper process detection — isServeSimHelperCommand now matches 0.1.47's node-hosted detached helper (--exit-on-simulator-shutdown token plus a serve-sim / serve-sim.js entry path), keeps the legacy serve-sim-bin shape so a pre-update orphan is still found and killed, and deliberately skips one-shot tap/type/--detach calls.
  • Executable bits — the removed bin/serve-sim-bin is replaced by the shared SERVE_SIM_EXECUTABLE_RELATIVE_PATHS list (4 standalone Mach-O helpers), applied by the dev node_modules fallback, the runtime materializer, and electron-builder's afterPack; the napi addon is dlopen'd and needs no +x.
  • Tests — new cases for the node-hosted helper shape and one-shot skip, plus a check that every named executable exists in the installed package so a future upstream layout change fails CI.

I verified the load-bearing external contract directly against the installed [email protected]: its iX() / A5() spawn the detached helper as <process.execPath> <serve-sim.js> <udid> --port N --host 127.0.0.1 --exit-on-simulator-shutdown, which is exactly the shape the new matcher expects, and the four helper paths exist. I also confirmed BSD ps uses unlimited command width when stdout is not a tty, so the trailing flag is not truncated by the existing -axo pid=,command= probe. src/main/emulator (231 tests) and electron-builder-config.test.mjs (34 tests) pass.

The author has flagged the signed/notarized-build check as not yet run; node-pty is an existing precedent for a signed extraResources .node loaded by the main process, so that path is likely fine. Nothing blocking.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: c4846065-f11c-496a-a0b1-92548f14faef

📥 Commits

Reviewing files that changed from the base of the PR and between 7449c91 and 9dab316.

📒 Files selected for processing (2)
  • src/main/emulator/serve-sim-runtime-materializer.test.ts
  • src/main/emulator/serve-sim-runtime-materializer.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The serve-sim dependency is upgraded from 0.1.40 to 0.1.47. Runtime materialization now places the package in a versioned node_modules directory, links available dependencies, and validates the package entry point and links. Executable-permission adjustments are removed from packaging and runtime paths. Process parsing now recognizes flagged Node-hosted helpers and standalone serve-sim processes.

Priority: ⬆️ High

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9dab3

No actionable merge-blocking issue is established. The runtime changes address dependency resolution and recognize the new helper; unverified packaged-build and platform combinations remain normal validation considerations.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9dab3

The changes remain within the desktop simulator workflow. No new externally exposed interface or privilege increase was established, but packaged native-code integrity and interruption recovery were not fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated exposure is the desktop user's executable runtime, bundled dependency code, simulator session, and helper-process cleanup. The inspected paths do not establish a new remote or cross-tenant authority path.

Trust Boundaries and Controls

  • observed — Dependency metadata comes from the selected bundled package, and reuse checks expected dependency realpaths. Helper lookup requires a recognized command plus either a known PID or, when orphan lookup is enabled, the device UDID token. These are selection controls, not proof of executable provenance.

Resilience and Maintainability Implications

  • observed — Reuse validation catches manifest and path-resolution failures and treats the runtime as stale. Preparation failures return null, and staging cleanup runs in finally. These controls contradict an exception-escape finding, but do not demonstrate crash-safe replacement or uninterrupted availability.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies the coding objectives in [#11388] and [#17587]. It upgrades serve-sim to 0.1.47, runs the Node-hosted dist/serve-sim.js entry point, and materializes the package with its ws d…
Out of Scope Changes check ✅ Passed The changes stay within [#11388] and [#17587]. The dependency upgrade, runtime materialization, package dependency linking, helper-process detection, executable handling, and related tests support Xco…
Title check ✅ Passed The title clearly identifies the main change: upgrading serve-sim to address iOS simulator failures on Xcode 27.
Description check ✅ Passed The description is complete and relevant. It includes the required ELI5, change summary, rationale, linked issues, visual proof, testing details, review notes, and checklist. It also clearly documents…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…dy ships helpers executable

serve-sim publishes its helpers as 755 and pnpm, fs.cpSync and electron-builder
all preserve the mode, so the executables list and every chmod over it are dead.
Comment on lines 56 to 59
if (process.platform !== 'win32') {
for (const executable of [
join(materialized!, 'bin', 'serve-sim-bin'),
join(materialized!, 'dist', 'simcam', 'serve-sim-camera-helper')
]) {
expect(((await stat(executable)).mode & 0o111) !== 0).toBe(true)
}
const helper = join(materialized!, 'dist', 'simcam', 'serve-sim-camera-helper')
expect(((await stat(helper)).mode & 0o111) !== 0).toBe(true)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Package helper check removed

The removed test was the only check that every named standalone helper exists in the installed serve-sim package. The replacement fixture creates only the camera helper, so these tests could pass after a package-layout change leaves an AX or duo helper missing. Please retain a check against the installed package so that such a change fails CI.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — the follow-up commit that drops the redundant serve-sim chmod and the shared executable-path module, then the full PR end to end.

  • Removed every serve-sim chmod — materializeServeSimRuntime, the dev node_modules fallback in resolveServeSimExecutable, and electron-builder's afterPack no longer chmod helpers, and the serve-sim-package-executables.ts constant plus its consumers are deleted.
  • Simplified the materializer test — the fixture helper is written 0o755 and the test asserts it stays executable through the copy; the "installed package ships these executables" case is gone with the constant.
  • Comment-only change in serve-sim-helper-processes.ts clarifying why the legacy serve-sim-bin shape is still matched.

I re-verified the commit's load-bearing premise independently: the installed node_modules/serve-sim carries 755 on bin/serve-sim-bin, dist/simcam/serve-sim-camera-helper, and even the dylib — and nothing in Orca ever chmodded the dylib, so pnpm preserves the tarball mode. config/scripts/space-sharing-copy.mjs already documents that cpSync carries the source mode, and electron-builder copies the package directories through builder-util, which preserves it. The [email protected] bump and the node-hosted helper matcher from the parent commit are unchanged and were verified in the prior review. Nothing blocking.

ℹ️ The executable-bit guarantee now rests entirely on the upstream package

With the chmod and the package-layout test both gone, nothing in CI asserts that the installed serve-sim ships its helpers executable — the materializer test uses a 0o755 fixture, so it passes even if the real package dropped the bit. This is a defer-able coverage gap, not a defect in the current change.

Technical details
# Executable-bit assumption is unasserted in CI

## Affected sites
- `src/main/emulator/serve-sim-runtime-materializer.test.ts:17` — fixture writes the helper `0o755`, so the "stays executable" assertion holds regardless of what the real package ships.
- `serve-sim-package-executables.ts` (deleted) — its `names executables the installed serve-sim package ships` test was the only check against the installed package layout.

## Required outcome
- Optional: a cheap test that the installed `node_modules/serve-sim/dist/simcam/serve-sim-camera-helper` (or any standalone helper serve-sim spawns) has an executable bit, so a future bump shipping `0644` fails CI instead of only failing camera injection in a packaged build.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/emulator/serve-sim-runtime-materializer.test.ts (1)

17-19: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy lift

Add executable-mode checks for published and packaged artifacts.

The fixture starts with an executable helper, and the test checks only the materialized copy. No packaging test checks the published [email protected] package or the final electron-builder output. Add checks for dist/simcam/serve-sim-camera-helper at both boundaries.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 625c10c1-6e0e-4307-925b-9c65f2c795ea

📥 Commits

Reviewing files that changed from the base of the PR and between 45efc7e and 7449c91.

📒 Files selected for processing (5)
  • config/electron-builder.config.cjs
  • src/main/emulator/serve-sim-execution.ts
  • src/main/emulator/serve-sim-helper-processes.ts
  • src/main/emulator/serve-sim-runtime-materializer.test.ts
  • src/main/emulator/serve-sim-runtime-materializer.ts
💤 Files with no reviewable changes (1)
  • config/electron-builder.config.cjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

…dencies

serve-sim 0.1.47's entry imports `ws`. Packaged macOS builds run serve-sim from
a copy under userData, and that copy had no node_modules, so every iOS emulator
attach failed with ERR_MODULE_NOT_FOUND. Dev builds were unaffected because
they run serve-sim straight from pnpm's node_modules.

Lay the copy out as <version>/node_modules/serve-sim and link each dependency
the package declares to the bundle's installed sibling, so transitive deps keep
resolving from the bundle. A runtime in the old flat layout, or one whose links
dangle because the app moved, is rebuilt instead of reused.
Comment on lines +35 to +38
return (
commandContainsToken(command, SERVE_SIM_DETACHED_HELPER_FLAG) &&
/(^|\/)serve-sim(?:\.js)?\s/.test(command)
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unrelated simulator helper terminated

When Orca stops a device with orphan cleanup enabled, this match also accepts an independently launched /usr/local/bin/serve-sim helper for the same UDID. The cleanup then sends that process SIGTERM, interrupting a simulator session Orca does not own. Restrict orphan cleanup to helpers attributable to Orca.

Comment on lines +273 to +275
for (const name of dependencyNames) {
symlinkDir(join(installedPackageDir, '..', name), join(bundledNodeModulesDir, name))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Test requires omitted dependency

If inspect-webkit is absent, as the packaging path explicitly permits, this test links to its nonexistent directory and then requires every declared dependency to resolve. The emulator test suite therefore fails on a permitted install even though the materializer skips missing dependencies. Probe only dependencies that are actually bundled.

mkdirSync(targetRootDir, { recursive: true })
pruneStaleServeSimRuntimes(targetRootDir, version)
rmSync(stagingDir, { recursive: true, force: true })
rmSync(targetDir, { recursive: true, force: true })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Concurrent runtime copy removed

If two permitted app instances sharing userData materialize the same version concurrently, both can see an absent or stale runtime. One can publish its copy before the other reaches this unconditional removal, which deletes files beneath a runtime the first instance has already returned or launched. The practical cost is intermittent simulator startup or camera-helper failure.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — commit 9dab316 ("give the materialized serve-sim runtime its node dependencies") since the prior pullfrog review, plus the full PR end to end.

  • Dependency links for the materialized runtime — bundledDependencyLinks reads the bundled package's dependencies and symlinks each name that exists as a sibling of the bundle package into <userData>/serve-sim-runtime/<appVersion>/node_modules/, so the copied dist/serve-sim.js can resolve its bare ws/inspect-webkit imports. Absent siblings are filtered out.
  • Reuse and staleness detection — isMaterializedRuntimeCurrent requires the new node_modules/serve-sim/dist/serve-sim.js entry plus every link's realpath matching its target, so an old flat-layout runtime, a moved or translocated app, or dangling links all trigger a rebuild.
  • Quarantine ordering — clearQuarantine now runs on the copied package dir before the links are created, keeping the recursive xattr walk out of the signed bundle; cpSync uses realpathSync(bundledPackageDir) so a pnpm symlinked package is copied as content.
  • Tests — new coverage for link creation/skip, quarantine-before-link ordering, old-layout and dangling-link rebuilds, and a regression test that copies the real installed serve-sim and probes import.meta.resolve for every declared dependency, which fails with ERR_MODULE_NOT_FOUND on the previous materializer.

I verified the load-bearing pieces independently: [email protected]'s dist/serve-sim.js imports only ws and inspect-webkit (sonner is declared but never referenced in dist/*.js, so its peer react/react-dom chain never runs), and config/packaged-runtime-node-modules.cjs already flattens those same packages to Resources/node_modules/<name>, so the sibling lookup that dirname(realpathSync(bundledPackageDir)) relies on holds in packaged builds. The tarball's helpers are all 755, consistent with the earlier chmod removal.

One environment note: the review sandbox still has [email protected] installed, so the real-package regression test could not be executed here — it needs a fresh pnpm install to assert dependencyNames contains ws. No concerns with the change itself.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 2ab179c into main Oct 1, 2026
56 of 58 checks passed
Jinwoo-H added a commit that referenced this pull request Oct 4, 2026
serve-sim drives the iOS Simulator, which exists only on macOS. Since 0.1.47
(#24228) it carries a Mach-O addon, and Windows signing rejects every *.node
that is not a PE file, so the v1.4.220 Windows build failed at SignPath.
Jinwoo-H added a commit that referenced this pull request Oct 4, 2026
serve-sim drives the iOS Simulator, which exists only on macOS. Since 0.1.47
(#24228) it carries a Mach-O addon, and Windows signing rejects every *.node
that is not a PE file, so the v1.4.220 Windows build failed at SignPath.

(cherry picked from commit 94f5669)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Xcode 27 SimulatorKit relocation [Bug]: iOS Emulator doesn't work on macos 27

1 participant