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

Method avd_name_for_serial

packages/server/src/android.rs:891–909  ·  view source on GitHub ↗
(&self, serial: &str)

Source from the content-addressed store, hash-verified

889 }
890
891 fn avd_name_for_serial(&self, serial: &str) -> Option<String> {
892 for property in ["ro.boot.qemu.avd_name", "ro.kernel.qemu.avd_name"] {
893 if let Ok(output) = self.run_adb(["-s", serial, "shell", "getprop", property]) {
894 let name = output.trim();
895 if !name.is_empty() {
896 return Some(name.to_owned());
897 }
898 }
899 }
900 self.run_adb(["-s", serial, "emu", "avd", "name"])
901 .ok()
902 .and_then(|output| {
903 output
904 .lines()
905 .map(str::trim)
906 .find(|line| !line.is_empty() && *line != "OK")
907 .map(ToOwned::to_owned)
908 })
909 }
910
911 fn console_port_for_avd(&self, avd_name: &str) -> Result<u16, AppError> {
912 static CACHE: OnceLock<Mutex<TimedMap<u16>>> = OnceLock::new();

Callers 1

running_emulatorsMethod · 0.80

Calls 2

run_adbMethod · 0.80
is_emptyMethod · 0.80

Tested by

no test coverage detected