Expand description
smix-driver — decide layer (CLAUDE.md §12.1 middle).
Wraps HttpRunnerClient (sense + act IPC) with host-side resolve
dispatch. Path B is default since v1.5 c5i-a S6: SDK call →
driver.tap → tree() → resolve_selector() → centroid →
runner.tap_at_norm_coord() (v1.6 c5 Apple native event chain).
Ported from now-retired TS source: src/driver/simctl-driver.ts (only the
runner-client-bound methods; simctl child_process methods like
launch / terminate / install / pasteboard / grantPermission land
in c10 smix-simctl outer crate).
§Failure model
All methods return Result<T, ExpectationFailure> (跟 TS throws +
AI-readable rendering via smix-error).
§Implicit wait (v1.5 c5i-d)
tap includes a 5s poll-and-retry loop (跟 TS line 754-755 wait-and-
tap merged pattern): if the first resolve_selector returns None,
sleep 250 ms then re-fetch tree + re-resolve, up to a 5s total
budget. Once a candidate is found we tap the same frame to avoid
split-fetch race (跟 TS line 747-753 注释 同源).
Structs§
- Android
Driver - Android
Driverimpl. WrapsHttpRunnerClientconnecting to the Kotlin runner via adb-forwarded port (default 28080, configurable viaAndroidDriver::new(port)). - Http
Runner Client - HTTP client to the swift-side SmixRunnerCore. Async (tokio-based).
Constructed once per Cell;
ensure_reachablememoizes a successful/healthprobe so subsequent calls don’t re-probe. - IosDriver
- v6.0 c1a — renamed from
SimctlDrivertoIosDriverto make platform explicit in the cross-platform Driver trait architecture (seedocs/plan-cold/v6-cross-platform-yaml-design.md§7). Type aliaspub type SimctlDriver = IosDriver(in lib.rs re-export) keeps existing v5.x callers working without source-edit ripple. - OcrFrame
- v5.19 c1 — normalized OCR bounding box returned by
HttpRunnerClient::find_text_by_ocr. Coordinates are normalized to[0, 1]in UIKit coord space (top-left origin, y-down). Apple Vision’s native bbox is bottom-left origin + y-up — the swift handler converts before returning so all consumers see UIKit coords. - System
Popup - One system-popup discovered on the screen (alert / sheet / banner).
Enums§
- Include
Scope includescope literal — currently onlyall-windows(system popups pierce the app frame).- Orientation
- v5.2 c5 — sim device orientation. Driver-level type; SDK exposes a
1:1
MaestroOrientationmirror for maestro yaml literal alignment. - Platform
- Platform identifier for cross-platform dispatch.
- Runner
Scroll Selector - Reduced selector shape used by
/scroll(text-or-id only; complex selectors are host-side-resolved before reaching the runner). - Runner
Transport Error - Transport-level failure (network, non-2xx, malformed body). Mirrors
TS
RunnerTransportError1:1. - TapMode
POST /tapmode discriminator.
Traits§
- Driver
- Sense + act capabilities for a single device. Two-trait architecture
pair with
smix_sdk::DeviceControl(sim/host control in smix-sdk).
Type Aliases§
- Simctl
Driver - Back-compat alias for v5.x callers.
SimctlDriverwas renamed toIosDriverin v6.0 c1a (cross-platform naming); this alias keeps existing importsuse smix_driver::SimctlDrivercompiling.