(adb, serial)
| 658 | } |
| 659 | |
| 660 | function 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 | |
| 686 | function androidSdkTool(relativePath) { |
| 687 | const roots = [ |
no test coverage detected