apple_clis/xcrun/simctl/
install.rs

1use super::XcRunSimctlInstance;
2use crate::prelude::*;
3
4pub use output::*;
5mod output;
6
7impl XcRunSimctlInstance<'_> {
8	#[instrument(skip_all, ret)]
9	pub fn install_booted(&self, app_path: impl AsRef<Utf8Path>) -> Result<InstallOutput> {
10		let app_path = app_path.as_ref();
11		InstallOutput::from_bossy_result(
12			self
13				.bossy_command()
14				.with_arg("install")
15				.with_arg("booted")
16				.with_arg(app_path)
17				.run_and_wait_for_output(),
18		)
19	}
20
21	#[instrument(skip_all, ret)]
22	pub fn install(
23		&self,
24		app_path: impl AsRef<Utf8Path>,
25		booted_simulator: &DeviceName,
26	) -> Result<InstallOutput> {
27		let app_path = app_path.as_ref();
28		InstallOutput::from_bossy_result(
29			self
30				.bossy_command()
31				.with_arg("install")
32				.with_arg(booted_simulator.to_string())
33				.with_arg(app_path)
34				.run_and_wait_for_output(),
35		)
36	}
37}