Skip to content

Commit

Permalink
Create emulator with ability to overwrite
Browse files Browse the repository at this point in the history
This is necessary on a custom runner, when previous job failed
  • Loading branch information
hannesa2 committed Apr 27, 2023
1 parent 7657cd1 commit 365b221
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion emulator-run-cmd/lib/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++);
});
}
Expand Down
2 changes: 1 addition & 1 deletion emulator-run-cmd/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
}

Expand Down
2 changes: 1 addition & 1 deletion install-sdk/lib/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++);
});
}
Expand Down
2 changes: 1 addition & 1 deletion install-sdk/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
}

Expand Down

0 comments on commit 365b221

Please sign in to comment.