Repository navigation
fix(emulator): take serve-sim 0.1.47 so the iOS simulator works on Xcode 27 - #24228
Conversation
…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.
|
| "qrcode": "^1.5.4", | ||
| "react-i18next": "17.0.15", | ||
| "serve-sim": "0.1.40", | ||
| "serve-sim": "0.1.47", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
✅ 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
dyldfailure in #11388/#17587; also picks up the upstream Xcode 27 boot-hang fix. - Helper process detection —
isServeSimHelperCommandnow matches 0.1.47's node-hosted detached helper (--exit-on-simulator-shutdowntoken plus aserve-sim/serve-sim.jsentry path), keeps the legacyserve-sim-binshape so a pre-update orphan is still found and killed, and deliberately skips one-shottap/type/--detachcalls. - Executable bits — the removed
bin/serve-sim-binis replaced by the sharedSERVE_SIM_EXECUTABLE_RELATIVE_PATHSlist (4 standalone Mach-O helpers), applied by the devnode_modulesfallback, the runtime materializer, and electron-builder'safterPack; 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.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe 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 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 ReviewSecurity architecture risk: 🔵 Low · up to 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 Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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. Comment |
…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.
| 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) | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
✅ 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-simchmod —materializeServeSimRuntime, the devnode_modulesfallback inresolveServeSimExecutable, and electron-builder'safterPackno longer chmod helpers, and theserve-sim-package-executables.tsconstant plus its consumers are deleted. - Simplified the materializer test — the fixture helper is written
0o755and 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.tsclarifying why the legacyserve-sim-binshape 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.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/emulator/serve-sim-runtime-materializer.test.ts (1)
17-19: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy liftAdd 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 fordist/simcam/serve-sim-camera-helperat both boundaries.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 625c10c1-6e0e-4307-925b-9c65f2c795ea
📒 Files selected for processing (5)
config/electron-builder.config.cjssrc/main/emulator/serve-sim-execution.tssrc/main/emulator/serve-sim-helper-processes.tssrc/main/emulator/serve-sim-runtime-materializer.test.tssrc/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.
| return ( | ||
| commandContainsToken(command, SERVE_SIM_DETACHED_HELPER_FLAG) && | ||
| /(^|\/)serve-sim(?:\.js)?\s/.test(command) | ||
| ) |
There was a problem hiding this comment.
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.
| for (const name of dependencyNames) { | ||
| symlinkDir(join(installedPackageDir, '..', name), join(bundledNodeModulesDir, name)) | ||
| } |
There was a problem hiding this comment.
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 }) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
✅ 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 —
bundledDependencyLinksreads the bundled package'sdependenciesand symlinks each name that exists as a sibling of the bundle package into<userData>/serve-sim-runtime/<appVersion>/node_modules/, so the copieddist/serve-sim.jscan resolve its barews/inspect-webkitimports. Absent siblings are filtered out. - Reuse and staleness detection —
isMaterializedRuntimeCurrentrequires the newnode_modules/serve-sim/dist/serve-sim.jsentry plus every link'srealpathmatching its target, so an old flat-layout runtime, a moved or translocated app, or dangling links all trigger a rebuild. - Quarantine ordering —
clearQuarantinenow runs on the copied package dir before the links are created, keeping the recursivexattrwalk out of the signed bundle;cpSyncusesrealpathSync(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.resolvefor every declared dependency, which fails withERR_MODULE_NOT_FOUNDon 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.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
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.

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-simgoes from 0.1.40 to 0.1.47. In 0.1.40,bin/serve-sim-binwas 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'sSharedFrameworkslocation. 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).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 nameserve-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 oldserve-sim-binshape, so a helper started by the previous Orca version (still running after an app update) is found and killed. One-shot commands such asserve-sim.js tap …or--detachare deliberately not matched.chmodsteps are removed rather than repointed. They covered the materialized runtime copy, the devnode_modulesfallback, and the packagingafterPackstep. 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 tvzfof the 0.1.47 tarball shows 755 on all four helpers, and the installednode_modulesfiles are 755. Afs.cpSyncof the extracted package keeps 755. In the shipped Orca.app,serve-sim.jsis 755 although nothing ever chmodded it.serve-sim-runtime-materializer.ts): on macOS, packaged Orca copies serve-sim fromContents/Resources/node_modules/serve-simto<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.47dist/serve-sim.jsimportsws, and the bare copy had nonode_modules, so in packaged builds every attach failed withERR_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'snode_modules.<version>/node_modules/serve-sim. Each name in the package's owndependenciesgets 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.xattrnever walks into the bundle.sonner, andws8.21.3, which Orca already ships). The packaged runtime closure is computed fromdependencies, 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-inputcommand. 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-shutdownflag plus theserve-simentry path is how serve-sim itself launches--detachhelpers. 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 screenshotand the AX tree.node_modulespath):emulator deviceslists the simulator, andemulator attachstarts…/node_modules/serve-sim/dist/serve-sim.js <udid> --port 3100 --host 127.0.0.1 --exit-on-simulator-shutdown.tapon the Settings search field plustype Orcaputs "Orca" in the field (AX shows "No Results for “Orca”").button homereturns to SpringBoard, and a 4-pointgestureswipe moves to home page 2.killremoves the helper and closes the port.electron-builder --dir, hardened runtime, signed with an Apple Development identity, driven by the bundledorcaCLI):wsERR_MODULE_NOT_FOUNDabove.Orca.app/Contents/MacOS/Orca <profile>/serve-sim-runtime/1.4.214/node_modules/serve-sim/dist/serve-sim.js <udid> …, withws,inspect-webkitandsonnerlinked into the bundle. Tap+type, home, swipe, AX and kill all behave as in dev.vmmapof the helper showsserve-sim-native.node(from the materialized copy) and Xcode'sSharedFrameworks/SimulatorKitloaded in the hardened-runtime process.codesign -dvshowsflags=0x10000(runtime)and the same TeamIdentifier on both the app and the addon, and the entitlements have nodisable-library-validation. So library validation accepts the re-signed addon and Apple's SimulatorKit.--detachreproduces the [Bug]: iOS Emulator doesn't work on macos 27 #11388 dyld error. 0.1.47 run Electron-as-node, plusIosEmulatorBackendunder a stubbedelectron, started, drove and stopped helpers cleanly.Automated:
pnpm test src/main/emulator: 31 files / 235 tests pass.nodeprocess then runsimport.meta.resolveon every declared dependency from inside the copieddist/. On the previous materializer it fails withERR_MODULE_NOT_FOUND; with the fix it passes.serve-sim-binmatch.config/scripts/electron-builder-*.test.mjs: 78 pass.pnpm tc:node, oxlint, oxfmt, andpnpm run check:code-quality:changedall pass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Not verified yet
PrivateFrameworkspath first, but I didn't exercise it.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)