polyhorn_cli/ios/tasks/
install_on_ios_simulator.rs1use simctl::Device;
2
3use super::{IOSContext, IOSError};
4use crate::core::{Manager, Task};
5
6pub struct InstallOnIOSSimulator {
9 pub configuration: String,
12
13 pub device: Device,
15}
16
17impl Task for InstallOnIOSSimulator {
18 type Context = IOSContext;
19 type Error = IOSError;
20
21 fn verb(&self) -> &str {
22 "Installing"
23 }
24
25 fn message(&self) -> &str {
26 "on iOS Simulator"
27 }
28
29 fn detail(&self) -> &str {
30 &self.device.name
31 }
32
33 fn run(
34 &self,
35 context: Self::Context,
36 _manager: &mut Manager,
37 ) -> Result<Self::Context, Self::Error> {
38 let target_dir = context.config.target_dir.join("polyhorn-ios");
39
40 self.device.install(
41 &target_dir.join(
42 format!(
43 "derived-data/Build/Products/{}-iphonesimulator/{}.app",
44 self.configuration, context.config.spec.app.name
45 )
46 .as_str(),
47 ),
48 )?;
49
50 Ok(context)
51 }
52}