|
@@ -38,10 +38,10 @@ function isDeviceRunning() {
|
38
|
38
|
|
39
|
39
|
function startEmulator() {
|
40
|
40
|
console.log(`Looking for avd...`);
|
41
|
|
- const avds = exec.execSyncRead(`${process.env.ANDROID_HOME}/tools/bin/avdmanager list avd -c`);
|
42
|
|
- const avdName = /^.*package\.xml(\S+)$/.exec(avds)[1];
|
|
41
|
+ const avdsRaw = exec.execSyncRead(`${process.env.ANDROID_HOME}/tools/bin/avdmanager list avd -c`);
|
|
42
|
+ const avdName = /^.*package\.xml(\S+)$/m.exec(avdsRaw)[1];
|
43
|
43
|
if (_.isEmpty(avdName)) {
|
44
|
|
- throw new Error(`Launch an android emulator or connect a device`);
|
|
44
|
+ throw new Error(`Can't find avd to launch. Please create an avd first.`);
|
45
|
45
|
}
|
46
|
46
|
console.log(`found avd name: ${avdName}, Launching...`);
|
47
|
47
|
exec.execAsyncSilent(`${process.env.ANDROID_HOME}/tools/emulator -gpu host -no-audio @${avdName}`);
|