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

Function list_studio_simulators

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

Source from the content-addressed store, hash-verified

3122}
3123
3124fn list_studio_simulators(server_url: &str) -> anyhow::Result<Vec<StudioSimulatorSelection>> {
3125 let response = service_get_json(server_url, "/api/simulators")?;
3126 let simulators = response
3127 .get("simulators")
3128 .and_then(Value::as_array)
3129 .cloned()
3130 .unwrap_or_default();
3131 Ok(simulators
3132 .into_iter()
3133 .filter_map(|value| {
3134 Some(StudioSimulatorSelection {
3135 udid: value.get("udid")?.as_str()?.to_owned(),
3136 name: value.get("name")?.as_str()?.to_owned(),
3137 runtime_name: value
3138 .get("runtimeName")
3139 .and_then(Value::as_str)
3140 .map(str::to_owned),
3141 is_booted: value
3142 .get("isBooted")
3143 .and_then(Value::as_bool)
3144 .unwrap_or(false),
3145 })
3146 })
3147 .collect())
3148}
3149
3150fn resolve_cli_device_udid(
3151 positional: Option<&str>,

Callers 4

select_studio_simulatorFunction · 0.85
resolve_cli_device_udidFunction · 0.85

Calls 3

service_get_jsonFunction · 0.85
getMethod · 0.65
as_strMethod · 0.45

Tested by

no test coverage detected