Skip to content

Commit 2514405

Browse files
hasunparkEmmaSnowFlakedoothezthymikee
authored
Fixed cannot start Android emulator version 34.1.20.0 (#2358)
* Fixed cannot start Android emulator version 34.1.20.0 * Fixed lint error * refactor: change logic for checking emulator name * style: specific comment for why we change filter Co-authored-by: Michał Pierzchała <thymikee@gmail.com> * fix: linter issue --------- Co-authored-by: Sung Hwan Lee <dootheg@gmail.com> Co-authored-by: Sung Hwan Lee <sung.hwan-lee@breville.com> Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
1 parent 92d2862 commit 2514405

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/cli-platform-android/src/commands/runAndroid/tryLaunchEmulator.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ const emulatorCommand = process.env.ANDROID_HOME
99
export const getEmulators = () => {
1010
try {
1111
const emulatorsOutput = execa.sync(emulatorCommand, ['-list-avds']).stdout;
12-
return emulatorsOutput.split(os.EOL).filter((name) => name !== '');
12+
return emulatorsOutput
13+
.split(os.EOL)
14+
.filter((name) => name !== '' && !name.includes(' '));
15+
// The `name` is AVD ID which is expected to not contain whitespace.
16+
// The `emulator` command, however, can occasionally return verbose
17+
// information about crashes or similar. Hence filtering out anything
18+
// that has basic whitespace.
1319
} catch {
1420
return [];
1521
}

0 commit comments

Comments
 (0)