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

Function androidAvdNameForSerial

scripts/integration/android.mjs:660–684  ·  view source on GitHub ↗
(adb, serial)

Source from the content-addressed store, hash-verified

658}
659
660function androidAvdNameForSerial(adb, serial) {
661 for (const property of ["ro.boot.qemu.avd_name", "ro.kernel.qemu.avd_name"]) {
662 try {
663 const name = runText(adb, ["-s", serial, "shell", "getprop", property], {
664 timeoutMs: 10_000,
665 }).trim();
666 if (name) {
667 return name;
668 }
669 } catch {
670 // Fall through to the next lookup. ADB can briefly expose devices
671 // before every shell service is ready.
672 }
673 }
674 try {
675 return runText(adb, ["-s", serial, "emu", "avd", "name"], {
676 timeoutMs: 10_000,
677 })
678 .split(/\r?\n/)
679 .map((line) => line.trim())
680 .find((line) => line && line !== "OK");
681 } catch {
682 return null;
683 }
684}
685
686function androidSdkTool(relativePath) {
687 const roots = [

Callers 1

runningAndroidAvdsFunction · 0.85

Calls 1

runTextFunction · 0.70

Tested by

no test coverage detected