mirror of
https://github.com/reactivecircus/android-emulator-runner.git
synced 2026-08-31 17:49:33 +00:00
Add input validations with tests.
This commit is contained in:
@@ -24,7 +24,7 @@ const SDK_URL = 'https://dl.google.com/android/repository/sdk-tools-darwin-43337
|
||||
* 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,
|
||||
* and the system image for the chosen API level, cpu/abi, and target.
|
||||
*/
|
||||
function installAndroidSdk(apiLevel, abi, target) {
|
||||
function installAndroidSdk(apiLevel, target, abi) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// download Android SDK if not already installed
|
||||
if (fs.existsSync(`${process.env.ANDROID_HOME}/tools/bin/sdkmanager`)) {
|
||||
@@ -37,8 +37,7 @@ function installAndroidSdk(apiLevel, abi, target) {
|
||||
}
|
||||
// install specific SDK tools
|
||||
console.log('Installing build tools, platform tools, platform and system image.');
|
||||
yield exec.exec(`yes | ${process.env.ANDROID_HOME}/tools/bin/sdkmanager --licenses`);
|
||||
yield exec.exec(`${process.env.ANDROID_HOME}/tools/bin/sdkmanager --update`);
|
||||
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}"`);
|
||||
|
||||
Reference in New Issue
Block a user