#[non_exhaustive]pub enum DeviceControlError {
Spawn(Error),
AppNotInstalled {
bundle_id: String,
udid: String,
},
NonZeroExit {
subcommand: String,
argv: Vec<String>,
code: i32,
stderr: String,
wall_ms: u64,
},
Malformed {
subcommand: String,
detail: String,
},
Timeout {
subcommand: String,
ms: u64,
},
CaptureBackpressure {
retry_after: Duration,
},
}Expand description
Failure variants for a device-control invocation.
DeviceControl is one trait across iOS and Android, and this is its error
type — AndroidDeviceControl raises it as much as the simctl path does.
The messages name the command that actually ran rather than assuming
simctl, so an Android failure does not send the reader to the wrong
toolchain by claiming to come from xcrun simctl.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Spawn(Error)
Failed to spawn the device-control process (PATH lookup / fork failure).
AppNotInstalled
The bundle is not installed on the device. simctl get_app_container exiting non-zero is the canonical signal —
surfaced as its own variant because “run a flow whose appId
names an app you have not installed yet” is the single most
common first-run mistake, and it used to read as a bare
subprocess error.
Fields
NonZeroExit
The device-control command exited non-zero.
Carries the full argv and wall_ms so the Display impl
surfaces every argument needed to reproduce the failure or file
a precise upstream bug — the subcommand name alone (e.g.
"spawn") does not say which binary or paths were touched.
Fields
argv: Vec<String>The full command as invoked, binary first — ["xcrun", "simctl", "boot", …] from simctl, ["adb", …] from the Android side.
The binary belongs here rather than in the Display format
string: this error type serves both platforms, and hard-coding
xcrun simctl made every Android failure name a tool that never
ran, sending the reader to the wrong toolchain.
Since smix 1.0.7.
Malformed
xcrun simctl <sub> exited 0 but stdout didn’t match the expected shape.
Timeout
xcrun simctl <sub> did not complete within the deadline.
CaptureBackpressure
The screenshot pacer’s circuit is open — a recent screenshot
wall time exceeded the circuit threshold, or a screenshot
failed. Callers should back off for retry_after and try
again. See screenshot_pacer::ScreenshotPacer.
Since smix 1.0.4.
Implementations§
Source§impl DeviceControlError
impl DeviceControlError
Sourcepub fn non_zero_exit(
subcommand: impl Into<String>,
code: i32,
stderr: impl Into<String>,
) -> DeviceControlError
pub fn non_zero_exit( subcommand: impl Into<String>, code: i32, stderr: impl Into<String>, ) -> DeviceControlError
Synthetic NonZeroExit for callers translating a foreign
subprocess error into DeviceControlError (e.g.
AndroidDeviceControl adapting adb failures). Fills
argv = [subcommand] + wall_ms = 0; when the caller has a
real argv, prefer the struct literal.
Trait Implementations§
Source§impl Debug for DeviceControlError
impl Debug for DeviceControlError
Source§impl Display for DeviceControlError
impl Display for DeviceControlError
Source§impl Error for DeviceControlError
impl Error for DeviceControlError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()