mirror of
https://github.com/reactivecircus/android-emulator-runner.git
synced 2026-08-31 17:49:33 +00:00
Add support for setting a custom working-directory.
This commit is contained in:
@@ -23,9 +23,9 @@ const BUILD_TOOLS_VERSION = '29.0.3';
|
||||
*/
|
||||
function installAndroidSdk(apiLevel, target, arch, emulatorBuild) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const sdkmangerPath = `${process.env.ANDROID_HOME}/tools/bin/sdkmanager`;
|
||||
const sdkmanagerPath = `${process.env.ANDROID_HOME}/tools/bin/sdkmanager`;
|
||||
console.log('Installing latest build tools, platform tools, and platform.');
|
||||
yield exec.exec(`sh -c \\"${sdkmangerPath} --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`);
|
||||
yield exec.exec(`sh -c \\"${sdkmanagerPath} --install 'build-tools;${BUILD_TOOLS_VERSION}' platform-tools 'platforms;android-${apiLevel}' > /dev/null"`);
|
||||
if (emulatorBuild) {
|
||||
console.log(`Installing emulator build ${emulatorBuild}.`);
|
||||
yield exec.exec(`curl -fo emulator.zip https://dl.google.com/android/repository/emulator-darwin-${emulatorBuild}.zip`);
|
||||
@@ -35,10 +35,10 @@ function installAndroidSdk(apiLevel, target, arch, emulatorBuild) {
|
||||
}
|
||||
else {
|
||||
console.log('Installing latest emulator.');
|
||||
yield exec.exec(`sh -c \\"${sdkmangerPath} --install emulator > /dev/null"`);
|
||||
yield exec.exec(`sh -c \\"${sdkmanagerPath} --install emulator > /dev/null"`);
|
||||
}
|
||||
console.log('Installing system images.');
|
||||
yield exec.exec(`sh -c \\"${sdkmangerPath} --install 'system-images;android-${apiLevel};${target};${arch}' > /dev/null"`);
|
||||
yield exec.exec(`sh -c \\"${sdkmanagerPath} --install 'system-images;android-${apiLevel};${target};${arch}' > /dev/null"`);
|
||||
});
|
||||
}
|
||||
exports.installAndroidSdk = installAndroidSdk;
|
||||
|
||||
Reference in New Issue
Block a user