polyhorn_cli/ios/tasks/
boot_ios_simulator.rs

1use simctl::Device;
2
3use super::{IOSContext, IOSError};
4use crate::core::{Manager, Task};
5
6/// This tasks boots an iOS Simulator with the given identifier.
7pub struct BootIOSSimulator {
8    /// This is the iOS Simulator that will be booted.
9    pub device: Device,
10}
11
12impl Task for BootIOSSimulator {
13    type Context = IOSContext;
14    type Error = IOSError;
15
16    fn verb(&self) -> &str {
17        "Booting"
18    }
19
20    fn message(&self) -> &str {
21        "iOS Simulator"
22    }
23
24    fn detail(&self) -> &str {
25        &self.device.name
26    }
27
28    fn run(
29        &self,
30        context: Self::Context,
31        _manager: &mut Manager,
32    ) -> Result<Self::Context, Self::Error> {
33        let _ = self.device.boot();
34
35        Ok(context)
36    }
37}