Fix sdk license issue with API 28+ system images on Linux.

This commit is contained in:
Yang Chen
2020-04-01 00:23:10 +11:00
committed by Yang
parent 0d966550cf
commit 49a3d042e9
5 changed files with 18 additions and 7 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import * as exec from '@actions/exec';
const EMULATOR_BOOT_TIMEOUT_SECONDS = 300;
const EMULATOR_BOOT_TIMEOUT_SECONDS = 600;
/**
* Creates and launches a new AVD instance with the specified configurations.
@@ -81,7 +81,7 @@ async function waitForDevice(): Promise<void> {
break;
}
} catch (error) {
console.log(error.message);
console.warn(error.message);
}
if (attempts < maxAttemps) {
+6 -1
View File
@@ -20,7 +20,12 @@ export async function installAndroidSdk(apiLevel: number, target: string, arch:
// add paths for commandline-tools and platform-tools
core.addPath(`${process.env.ANDROID_HOME}/cmdline-tools/tools:${process.env.ANDROID_HOME}/cmdline-tools/tools/bin:${process.env.ANDROID_HOME}/platform-tools`);
await exec.exec(`sh -c \\"sudo chmod -R 777 ${process.env.ANDROID_HOME}"`);
// additional permission and license requirements for Linux
if (!isOnMac) {
await exec.exec(`sh -c \\"sudo chmod -R 777 ${process.env.ANDROID_HOME}"`);
await exec.exec(`sh -c \\"echo -e '\n84831b9409646a918e30573bab4c9c91346d8abd' > ${process.env.ANDROID_HOME}/licenses/android-sdk-preview-license"`);
}
console.log('Installing latest build tools, platform tools, and platform.');