Support multi-line script.

This commit is contained in:
Yang Chen
2019-12-13 18:17:53 +11:00
committed by ychescale9
parent ae2123e35c
commit 9739504a54
8 changed files with 114 additions and 19 deletions
+2 -3
View File
@@ -66,7 +66,7 @@ function killEmulator() {
yield exec.exec(`${ADB_PATH} -s emulator-5554 emu kill`);
}
catch (error) {
console.log('No emulator running on port 5554');
console.log(error.message);
}
});
}
@@ -76,7 +76,6 @@ exports.killEmulator = killEmulator;
*/
function waitForDevice() {
return __awaiter(this, void 0, void 0, function* () {
const adbPath = `${process.env.ANDROID_HOME}/platform-tools/adb`;
let booted = false;
let attempts = 0;
const retryInterval = 2; // retry every 2 seconds
@@ -84,7 +83,7 @@ function waitForDevice() {
while (!booted) {
try {
let result = '';
yield exec.exec(`${adbPath} shell getprop sys.boot_completed`, [], {
yield exec.exec(`${ADB_PATH} shell getprop sys.boot_completed`, [], {
listeners: {
stdout: (data) => {
result += data.toString();