Add emulator-launcher.

This commit is contained in:
Yang Chen
2019-11-07 15:26:16 +11:00
parent f5529b9551
commit 34df1eaf0e
13 changed files with 247 additions and 38 deletions
+5 -6
View File
@@ -18,7 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
const exec = __importStar(require("@actions/exec"));
const tc = __importStar(require("@actions/tool-cache"));
const fs = __importStar(require("fs"));
const BUILD_TOOLS_VERSION = '29.0.2';
const SDK_URL = 'https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip';
/**
* Downloads and installs the Android SDK for the macOS platform, including SDK platform for the chosen API level, latest build tools, platform tools, Android Emulator,
@@ -37,11 +36,11 @@ function installAndroidSdk(apiLevel, target, abi) {
}
// install specific SDK tools
console.log('Installing build tools, platform tools, platform and system image.');
yield exec.exec(`echo "y" | ${process.env.ANDROID_HOME}/tools/bin/sdkmanager --licenses > /dev/null`);
yield exec.exec(`${process.env.ANDROID_HOME}/tools/bin/sdkmanager "build-tools;${BUILD_TOOLS_VERSION}"`);
yield exec.exec(`${process.env.ANDROID_HOME}/tools/bin/sdkmanager "platform-tools"`);
yield exec.exec(`${process.env.ANDROID_HOME}/tools/bin/sdkmanager "platforms;android-${apiLevel}"`);
yield exec.exec(`${process.env.ANDROID_HOME}/tools/bin/sdkmanager "system-images;android-${apiLevel};${target};${abi}"`);
const sdkmangerPath = `${process.env.ANDROID_HOME}/tools/bin/sdkmanager`;
yield exec.exec(`echo "y" | ${sdkmangerPath} --licenses > /dev/null`);
yield exec.exec(`${sdkmangerPath} tools platform-tools "platforms;android-${apiLevel}"`);
yield exec.exec(`${sdkmangerPath} "system-images;android-${apiLevel};${target};${abi}"`);
yield exec.exec(`bash -c \\"${sdkmangerPath} --update > /dev/null"`);
});
}
exports.installAndroidSdk = installAndroidSdk;