apple_clis/xcrun/simctl/
boot.rs

1use crate::{prelude::*, shared::identifiers::DeviceName};
2
3
4use super::XcRunSimctlInstance;
5
6pub use self::output::BootOutput;
7mod output;
8
9impl XcRunSimctlInstance<'_> {
10	/// This will not fail if the device is already booted,
11	/// but will return [BootOutput::AlreadyBooted] in that case.
12	#[tracing::instrument(skip_all, ret)]
13	pub fn boot(&self, device_name: impl Into<DeviceName>) -> Result<BootOutput> {
14		BootOutput::from_bossy_result(
15			self
16				.bossy_command()
17				.with_arg("boot")
18				.with_arg(device_name.into().to_string())
19				.run_and_wait_for_output(),
20		)
21	}
22}