Repository navigation
Description
Problem or use case
I work on two iOS projects side by side, each in its own Orca worktree, each with its own dedicated simulator. Only one of them can be visible at any moment: whichever worktree attaches last takes over, and both emulator panes end up mirroring the same device.
The stream helper is the bottleneck. Every orca emulator attach spawns a fresh serve-sim on port 3100 and kills the previous one, so lsof -nP -iTCP:3100-3110 -sTCP:LISTEN never shows more than a single serve-sim process. --worktree <selector> does not isolate it: attaching worktree B's device while sitting in worktree A switches both worktrees onto that device. And since Window only offers Minimize and Zoom, a second Orca window isn't an option either.
This is not a serve-sim limitation. Its own README states "Multiple booted simulators are supported", and -p, --port is documented as a starting port. Starting a second stream by hand with the bundled CLI does work — node /Applications/Orca.app/Contents/Resources/serve-sim/dist/serve-sim.js --no-preview --detach <UDID> lands on 3101 and orca emulator list --worktree all lists both — but the pane pulls everything back to 3100 shortly after.
Concretely, this means an agent can't drive app A while I test app B, and a two-project mobile session degrades into constantly re-attaching.
Proposed solution
Let each worktree own its emulator stream, the way browser tabs are already scoped:
- allocate a distinct port per attached device instead of reusing 3100, and keep existing helpers alive when a different worktree attaches;
- have each emulator pane bind to its worktree's stream rather than to whatever currently holds 3100;
- allow several emulator panes to be open at once, one per worktree.
A --port passthrough on orca emulator attach would already unblock scripted setups, even before the UI supports multiple panes.
Alternatives or additional context
Current workaround: keep one project in Orca's emulator pane and open the others in Apple's Simulator.app, which shows one window per booted device natively. It works, but those devices are then outside Orca — no orca emulator ax, tap or type on them, so agents can't drive them.
Environment: Orca 1.4.167, macOS 15 (Darwin 25.5), Xcode 26.5, two iOS 26.5 simulators (iPhone 17 devices).
Side note that may share a root cause: when a simulator is booted outside Orca (xcrun simctl boot <UDID>, no Simulator.app), the video stream works but the accessibility tree stays permanently empty — orca emulator ax returns a single Application node with no label and a 0×0 frame, and neither kill + attach nor relaunching the app restores it. Booting through orca emulator attach avoids it. Happy to open that separately if it's unrelated.
Activity
AmethystLiang commentedon Sep 13, 2026
Additional report: with two worktrees configured to use different iOS simulators, agent-driven automation in one worktree can affect the simulator selected by the other. An extra simulator screen may also appear concurrently. The selector in each worktree still displays a different device, so the visible configuration and the automation target have diverged.
High-level proposed solution:
(execution host, worktree, device UDID)resource, with the device-to-session mapping owned by the execution host.serve-simport/session identity per device (or reuse only the existing session for that exact device); never allow a new worktree attach to replace another worktree session.serve-simstate.This would preserve parallel iOS workflows and make the worktree device selector authoritative for both UI and agent automation.
Masiriope commentedon Sep 13, 2026
Additional observation from 2026-09-13: this affects action routing as well as video. During two concurrent iOS worktree sessions with distinct simulators, attaching the second simulator replaced the shared
serve-simtarget on port 3100. Subsequent taps and text from the first session could land on the second simulator. This matches the existing report and the previous comment. The currently installed Orca version is 1.4.194.Reproduction sequence:
We stopped using the shared emulator action path and directed
axe/simctlexplicitly by device UDID. Unsaved input was discarded, and application data was checked afterwards; no persistent changes resulted from the crossed actions in this session.Acceptance coverage should exercise both devices concurrently, checking that accessibility reads, text entry, gestures, and screenshots stay bound to the requested worktree/device. Attaching, detaching, or restarting B must not retarget or terminate A's session. If isolation is unavailable or ownership is ambiguous, return an explicit error before acting on a different simulator.
No application data or private project logs are included in this report.
johseffer commentedon Oct 22, 2026
+1, with a cross-platform use case. I'm porting a Flutter app from Android to iOS and need to compare the same flow on both platforms at the same time: an iOS Simulator (iPhone 17 Pro) and an Android emulator (AVD, scrcpy backend), each attached to its own worktree of the same repo.
Same result as described here: only one device is visible at a time, and switching worktrees swaps the emulator pane. The CLI side already works (
orca emulator attach <udid> --worktree id:<A>andorca emulator attach emulator-5554 --worktree id:<B>both returnok), so per-worktree streams — or letting the emulator pane be split/duplicated with a different device on each side (related: #26214, #4623) — would cover it.Environment: Orca 1.4.237, macOS 26.5 (Apple silicon), iOS Simulator runtime 26.5, Android emulator 37.2 / API 36.
nwparker commentedon Dec 1, 2026
Implemented on
main:EmulatorSessionRegistry(src/main/emulator/emulator-session-registry.ts) andEmulatorBridge(src/main/emulator/emulator-bridge.ts) track per-worktree active attachments (activeByWorktree) and independent per-device iOS (serve-sim) and Android (scrcpyVideoRegistry) sessions simultaneously.useEmulatorPaneSessionEvents(src/renderer/src/components/emulator-pane/session/use-emulator-pane-session-events.ts) scopes attach/shutdown events byworktreeId, PR #28176 (cbeb53714640) updatedserveSimKillArgs(src/main/emulator/serve-sim-execution.ts) to--kill=${udid}so stopping one simulator does not kill others, and PR #37127 (ac99f1cb3925) scopedemulator.listper worktree.