(server_url: &str)
| 3122 | } |
| 3123 | |
| 3124 | fn 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 | |
| 3150 | fn resolve_cli_device_udid( |
| 3151 | positional: Option<&str>, |
no test coverage detected