From 365b2212185486c1faf95041399fbfab2fb6336e Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Tue, 5 Jul 2022 10:12:37 +0200 Subject: [PATCH] Create emulator with ability to overwrite This is necessary on a custom runner, when previous job failed --- emulator-run-cmd/lib/sdk.js | 2 +- emulator-run-cmd/src/sdk.ts | 2 +- install-sdk/lib/sdk.js | 2 +- install-sdk/src/sdk.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/emulator-run-cmd/lib/sdk.js b/emulator-run-cmd/lib/sdk.js index e4216700..ac739b7c 100644 --- a/emulator-run-cmd/lib/sdk.js +++ b/emulator-run-cmd/lib/sdk.js @@ -119,7 +119,7 @@ class BaseAndroidSdk { if (hardwareProfile != null && hardwareProfile != "") { additionalOptions += `--device ${hardwareProfile}`; } - yield (0, exec_with_result_1.execIgnoreFailure)(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`); + yield (0, exec_with_result_1.execIgnoreFailure)(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --force --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`); return new emulator_1.Emulator(this, name, api, abi, tag, this.portCounter++, this.portCounter++); }); } diff --git a/emulator-run-cmd/src/sdk.ts b/emulator-run-cmd/src/sdk.ts index 132495b0..7f44bbc3 100644 --- a/emulator-run-cmd/src/sdk.ts +++ b/emulator-run-cmd/src/sdk.ts @@ -123,7 +123,7 @@ export abstract class BaseAndroidSdk implements AndroidSDK { additionalOptions += `--device ${hardwareProfile}` } - await execIgnoreFailure(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`) + await execIgnoreFailure(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --force --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`) return new Emulator(this, name, api, abi, tag, this.portCounter++, this.portCounter++) } diff --git a/install-sdk/lib/sdk.js b/install-sdk/lib/sdk.js index 65aa47f9..ae23933e 100644 --- a/install-sdk/lib/sdk.js +++ b/install-sdk/lib/sdk.js @@ -120,7 +120,7 @@ class BaseAndroidSdk { if (hardwareProfile != null && hardwareProfile != "") { additionalOptions += `--device ${hardwareProfile}`; } - yield (0, exec_with_result_1.execIgnoreFailure)(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`); + yield (0, exec_with_result_1.execIgnoreFailure)(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --force --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`); return new emulator_1.Emulator(this, name, api, abi, tag, this.portCounter++, this.portCounter++); }); } diff --git a/install-sdk/src/sdk.ts b/install-sdk/src/sdk.ts index 6300a2c5..bf1cc678 100644 --- a/install-sdk/src/sdk.ts +++ b/install-sdk/src/sdk.ts @@ -124,7 +124,7 @@ export abstract class BaseAndroidSdk implements AndroidSDK { additionalOptions += `--device ${hardwareProfile}` } - await execIgnoreFailure(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`) + await execIgnoreFailure(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --force --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`) return new Emulator(this, name, api, abi, tag, this.portCounter++, this.portCounter++) }