MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / infer_default_cli_simulator

Function infer_default_cli_simulator

packages/server/src/main.rs:3207–3223  ·  view source on GitHub ↗
(
    server_url: &str,
)

Source from the content-addressed store, hash-verified

3205}
3206
3207fn infer_default_cli_simulator(
3208 server_url: &str,
3209) -> anyhow::Result<Option<StudioSimulatorSelection>> {
3210 let simulators = list_studio_simulators(server_url)?;
3211 let booted = simulators
3212 .iter()
3213 .filter(|simulator| simulator.is_booted)
3214 .cloned()
3215 .collect::<Vec<_>>();
3216 if booted.len() == 1 {
3217 return Ok(booted.into_iter().next());
3218 }
3219 if booted.is_empty() && simulators.len() == 1 {
3220 return Ok(simulators.into_iter().next());
3221 }
3222 Ok(None)
3223}
3224
3225fn parse_tap_command_args(
3226 args: Vec<String>,

Callers 1

resolve_cli_device_udidFunction · 0.85

Calls 2

list_studio_simulatorsFunction · 0.85
is_emptyMethod · 0.80

Tested by

no test coverage detected