smix-simctl
Async Rust wrapper around Apple's xcrun simctl command-line tool.
Boot / shutdown / launch / install / pasteboard / screenshot — every
simulator-management subcommand wrapped in a typed tokio::process-backed
client.
This crate exists because every Rust project doing iOS simulator
automation re-implements the same Command::new("xcrun").arg("simctl")...
boilerplate, parses the same JSON outputs, fights the same pbcopy
stdin-pipe edge case. smix-simctl does it once, cleanly typed.
Quickstart
use ;
use Duration;
# async
Methods
| Category | Methods |
|---|---|
| Inventory | list_runtimes, list_devices |
| Lifecycle | boot, boot_and_wait, shutdown, erase, install, uninstall, terminate, launch |
| Settings | set_appearance, grant_permission, keychain_reset, set_reduce_motion |
| Pasteboard | pasteboard_get, pasteboard_set |
| URL | open_url |
| IO | screenshot (returns Vec<u8> PNG bytes) |
| Provisioning | create_device, delete_device |
When to reach for this vs. shelling out yourself
| Use case | Pick |
|---|---|
Need typed SimctlDevice / SimctlRuntime with is_available filter |
smix-simctl |
Want boot_and_wait polling logic without re-implementing it |
smix-simctl |
Need pasteboard_set (handles pbcopy stdin-pipe correctly) |
smix-simctl |
One-off shell script wrapping a single xcrun simctl boot call |
plain Command |
| Need real-device control (instruments, devicectl) | out of scope — this is sim-only |
Scope
- ✅ All async, returns typed
SimctlErrorvariants - ✅ Uses
tokio::process::Commandfor spawn - ✅ Parses JSON outputs (
list devices -j, etc.) into typed structs - ✅
screenshotreturns raw PNG bytes — no PNG parsing dep needed - ❌ No real-device support — this is
xcrun simctlonly - ❌ No
instruments/devicectlintegration - ❌ No XCUITest runner spawning (see
smix-runner-clientfor that)
Originally extracted from smix as a standalone stone. The crate is intentionally smix-business-decoupled — any Rust project doing iOS-Simulator automation can adopt it without pulling in the rest of smix.
License
Dual-licensed under either:
at your option.