Skip to content

Commit 2ac5bd0

Browse files
committed
Fix avd not getting recognized.
1 parent 3b88b92 commit 2ac5bd0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/commands/android/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,21 @@ export class AndroidSetup {
310310
return false;
311311
}
312312

313-
const stdout = execBinarySync(
313+
let stdout = execBinarySync(
314314
avdLocation,
315315
'avdmanager',
316316
this.platform,
317317
'list avd'
318318
);
319319

320320
if (stdout !== null) {
321-
const workingAvds = stdout.split('---------').filter((avd) => !avd.includes('Error: '));
321+
const nonWorkingAvdsIndex = stdout.indexOf('could not be loaded');
322322

323-
if (workingAvds.filter((avd) => avd.includes(NIGHTWATCH_AVD)).length) {
323+
if (nonWorkingAvdsIndex > -1) {
324+
stdout = stdout.slice(0, nonWorkingAvdsIndex);
325+
}
326+
327+
if (stdout.includes(NIGHTWATCH_AVD)) {
324328
return true;
325329
}
326330
}

0 commit comments

Comments
 (0)