MCPcopy Create free account
hub / github.com/callstack/agent-device / resolveAndroidEmulatorAvdName

Function resolveAndroidEmulatorAvdName

src/platforms/android/devices.ts:121–149  ·  view source on GitHub ↗
(
  serial: string,
  runAdb: AndroidAdbRunner = runCmd,
)

Source from the content-addressed store, hash-verified

119}
120
121export async function resolveAndroidEmulatorAvdName(
122 serial: string,
123 runAdb: AndroidAdbRunner = runCmd,
124): Promise<string | undefined> {
125 const avdPropKeys = ['ro.boot.qemu.avd_name', 'persist.sys.avd_name'];
126 for (const prop of avdPropKeys) {
127 const result = await runBestEffortAndroidEmulatorNameProbe(
128 serial,
129 ['shell', 'getprop', prop],
130 runAdb,
131 );
132 if (!result) continue;
133 const value = result.stdout.trim();
134 if (result.exitCode === 0 && value.length > 0) {
135 return value;
136 }
137 }
138 const emuResult = await runBestEffortAndroidEmulatorNameProbe(
139 serial,
140 ['emu', 'avd', 'name'],
141 runAdb,
142 );
143 if (!emuResult) return undefined;
144 const emuValue = parseAndroidEmulatorAvdNameOutput(emuResult.stdout);
145 if (emuResult.exitCode === 0 && emuValue) {
146 return emuValue;
147 }
148 return undefined;
149}
150
151export function parseAndroidTargetFromCharacteristics(rawOutput: string): 'tv' | null {
152 const normalized = rawOutput.toLowerCase();

Callers 2

devices.test.tsFile · 0.90
resolveAndroidDeviceNameFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…