Volume HID, bounded simctl, and interaction-paced simulator capture - #9
Merged
Merged
Conversation
Fold spawn_input_worker_with_capabilities back into spawn_input_worker, and share the framebuffer tick interval between the wait and the capture check.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Move iOS simulator settings from spawning `xcrun simctl ui` subprocesses to calling CoreSimulator's `SimDevice` getters and setters directly. Run the synchronous SimDevice calls on a dedicated worker thread and expose async methods on SimulatorControl. Add timeout handling and proper error propagation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three iOS Simulator changes, applied from a patch on top of the ADB socket work:
Volume/mute buttons.
SimulatorHIDgainspress_hid_button(page, usage, hold_ms), backed byIndigoHIDMessageForHIDArbitrary, which isdlsym'd optionally — volume up/down/mute are consumer-page usages (0x0c/0xe9,0xea,0xe2) rather than Indigo button IDs. Because the symbol may be absent, the worker reports what it resolved:SimSession::input_capabilities()exposes it so a client can hide the buttons instead of firing commands that fail on the HID thread.xcrun simctlcan no longer hang the caller.settings::simctlnow spawns and reaps with a 2s deadline (kill + wait on timeout) instead ofCommand::output(), which had no bound.Capture stays at the configured fps while the user is interacting. The framebuffer idle thread previously always slept
IDLE_INTERVAL(200ms), so a screen whose only change came from an in-flight gesture or its animation was re-emitted at ~5fps.SimSession::send_inputnow callscapture.note_interaction(), which pushesactive_until = now + 1sand wakes the thread through aCondvar; while active the tick interval is1s / config.fps.EncodedFrame/EncodedChunkalso carrycaptured_atfrom the framebuffer callback through the encoder, so latency can be measured against capture time rather than emit time.Massaging on top of the patch
spawn_input_workerwrapper that discarded the capabilities and had no callers; folded it into the single tuple-returningspawn_input_worker.CaptureState::tick_interval(active_until), called once before thewait_timeoutand once after it (an interaction can arrive while the thread is parked).REWIRE_INTERVALdoc comment, which the patch's hunk had eaten.Testing
cargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace --lib --bins,cargo test -p accessibility-cli --test cli_smoke— all green on Linux.Most of the diff is macOS-only and does not compile on this box; the
x86_64-apple-darwin/aarch64-apple-darwinbuild jobs are the first real compile of it, and nothing here has run against a booted simulator.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/d88fc07ea8064b38a4b4e5a7481ffebc
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/d88fc07ea8064b38a4b4e5a7481ffebc?variant=devin-insiders
Requested by: @jkelleyrtp