1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::{prelude::*, shared::identifiers::DeviceName};


use super::XcRunSimctlInstance;

pub use self::output::BootOutput;
mod output;

impl XcRunSimctlInstance<'_> {
	/// This will not fail if the device is already booted,
	/// but will return [BootOutput::AlreadyBooted] in that case.
	#[tracing::instrument(skip_all, ret)]
	pub fn boot(&self, device_name: impl Into<DeviceName>) -> Result<BootOutput> {
		BootOutput::from_bossy_result(
			self
				.bossy_command()
				.with_arg("boot")
				.with_arg(device_name.into().to_string())
				.run_and_wait_for_output(),
		)
	}
}