MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / stop_service

Function stop_service

packages/server/src/core_simulator.rs:32–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30}
31
32fn stop_service() -> anyhow::Result<()> {
33 match Command::new("killall")
34 .args(["-TERM", "com.apple.CoreSimulator.CoreSimulatorService"])
35 .output()
36 .context("run killall")?
37 {
38 output if output.status.success() => Ok(()),
39 output => {
40 let stderr = String::from_utf8_lossy(&output.stderr);
41 if stderr.contains("No matching processes") {
42 Ok(())
43 } else {
44 bail_with_output("killall CoreSimulatorService", output).map(|_| ())
45 }
46 }
47 }
48}
49
50fn run_xcrun<const N: usize>(args: [&str; N]) -> anyhow::Result<Output> {
51 let output = Command::new("xcrun")

Callers 2

shutdownFunction · 0.85
restartFunction · 0.85

Calls 2

bail_with_outputFunction · 0.85
outputMethod · 0.65

Tested by

no test coverage detected