You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please expose the gui-server's existing input-injection messages through the simulator's control protocol (simulator-cli), so UI automation against the hosted simulator doesn't have to synthesize macOS-level input events.
Everything needed already exists:
The gui-server API ships inject_touch() / inject_key() (SDK 1.0.0, api/gui-server/src/lib.rs), with wire messages InjectTouch (id 55) and InjectKey (id 56) in the service manifest.
simulator-cli already has an automation-flavored control protocol — ping (proto/caps), run <AppId>, screenshots, recording, scale, theme.
What's missing is the last inch: the messages are ungrouped (so a third-party app or tool can't be granted them), and simulator-cli has no command that forwards to them. A tap <x> <y> [down|up|move] and key <keycode> <down|up> in the control protocol — or alternatively a grantable permission group for the two messages in hosted builds — would close the gap.
Why
We drive full UI test suites against the hosted simulator (the harness behind the apps we've sideloaded on Passport Prime). Today the only way to deliver input is posting global CoreGraphics events at screen coordinates, which has real costs:
The suite owns the machine: the cursor is stolen, the sim window must be frontmost and unobstructed, and one stray human click mid-run silently diverts a tap and cascades failures.
Runs die with the screen locked or the Mac asleep — a CGEventPost into a locked session blocks indefinitely, so an overnight run just hangs.
Targeted delivery is a dead end: we measured CGEventPostToPid directly against the sim window (correct coordinates, unoccluded, before/after window-id captures byte-identical) — pid-posted events never reach the winit canvas.
With tap/key in the control protocol, suites become deterministic, headless-friendly, and machine-independent — no Accessibility permission, no screen geometry, no window management, and the sim could even run on a locked/CI machine.
Sketch
simulator-cli stdin commands, mirroring the existing style:
tap 240 400 # down+up at screen coords (480x800 space)
tapd 240 400 # down only
tapu 240 400 # up (for drags: tapd, tapm..., tapu)
tapm 240 380 # move while down
key 36 d / key 36 u # InjectKey press/release
forwarding to GuiServer::inject_touch / inject_key. caps=runInput in the ping reply would let harnesses feature-detect it.
Happy to test a build against our suites (nine of them, ~130 legs) and report back.
Summary
Please expose the gui-server's existing input-injection messages through the simulator's control protocol (
simulator-cli), so UI automation against the hosted simulator doesn't have to synthesize macOS-level input events.Everything needed already exists:
inject_touch()/inject_key()(SDK 1.0.0,api/gui-server/src/lib.rs), with wire messagesInjectTouch(id 55) andInjectKey(id 56) in the service manifest.simulator-clialready has an automation-flavored control protocol —ping(proto/caps),run <AppId>, screenshots, recording, scale, theme.What's missing is the last inch: the messages are ungrouped (so a third-party app or tool can't be granted them), and
simulator-clihas no command that forwards to them. Atap <x> <y> [down|up|move]andkey <keycode> <down|up>in the control protocol — or alternatively a grantable permission group for the two messages in hosted builds — would close the gap.Why
We drive full UI test suites against the hosted simulator (the harness behind the apps we've sideloaded on Passport Prime). Today the only way to deliver input is posting global CoreGraphics events at screen coordinates, which has real costs:
CGEventPostinto a locked session blocks indefinitely, so an overnight run just hangs.CGEventPostToPiddirectly against the sim window (correct coordinates, unoccluded, before/after window-id captures byte-identical) — pid-posted events never reach the winit canvas.With
tap/keyin the control protocol, suites become deterministic, headless-friendly, and machine-independent — no Accessibility permission, no screen geometry, no window management, and the sim could even run on a locked/CI machine.Sketch
simulator-clistdin commands, mirroring the existing style:forwarding to
GuiServer::inject_touch/inject_key.caps=runInputin thepingreply would let harnesses feature-detect it.Happy to test a build against our suites (nine of them, ~130 legs) and report back.