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

Function android_simulator_payload

packages/server/src/api/routes.rs:5546–5556  ·  view source on GitHub ↗
(state: AppState, udid: String)

Source from the content-addressed store, hash-verified

5544}
5545
5546async fn android_simulator_payload(state: AppState, udid: String) -> Result<Json<Value>, AppError> {
5547 let android_devices =
5548 run_android_action(state.clone(), |android| android.list_devices()).await?;
5549 let simulator = state
5550 .android
5551 .enrich_devices(android_devices)
5552 .into_iter()
5553 .find(|entry| entry.get("udid").and_then(Value::as_str) == Some(udid.as_str()))
5554 .ok_or_else(|| AppError::not_found(format!("Unknown Android emulator {udid}")))?;
5555 Ok(json(json_value!({ "simulator": simulator })))
5556}
5557
5558async fn simulator_payload(state: AppState, udid: String) -> Result<Json<Value>, AppError> {
5559 if android::is_android_id(&udid) {

Callers 3

boot_simulatorFunction · 0.85
shutdown_simulatorFunction · 0.85
simulator_payloadFunction · 0.85

Calls 7

run_android_actionFunction · 0.85
jsonFunction · 0.85
list_devicesMethod · 0.80
enrich_devicesMethod · 0.80
cloneMethod · 0.65
getMethod · 0.65
as_strMethod · 0.45

Tested by

no test coverage detected