Skip to content

Commit

Permalink
create ${process.env.HOME}/.android/avd
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Oct 11, 2024
1 parent e5f0ca8 commit 48163f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions lib/sdk-installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk
const isOnMac = process.platform === 'darwin';
const isArm = process.arch === 'arm64';
const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`;
if (fs.existsSync(cmdlineToolsPath)) {
yield io.rmRF(cmdlineToolsPath);
}
if (!fs.existsSync(cmdlineToolsPath)) {
console.log('Installing new cmdline-tools.');
const sdkUrl = isOnMac ? CMDLINE_TOOLS_URL_MAC : CMDLINE_TOOLS_URL_LINUX;
Expand All @@ -66,6 +63,7 @@ function installAndroidSdk(apiLevel, target, arch, channelId, emulatorBuild, ndk
// add paths for commandline-tools and platform-tools
core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_HOME}/platform-tools`);
// set standard AVD path
yield io.mkdirP(`${process.env.HOME}/.android/avd`);
core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`);
// accept all Android SDK licenses
yield exec.exec(`sh -c \\"yes | sdkmanager --licenses > /dev/null"`);
Expand Down
5 changes: 1 addition & 4 deletions src/sdk-installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ export async function installAndroidSdk(apiLevel: string, target: string, arch:
const isArm = process.arch === 'arm64';

const cmdlineToolsPath = `${process.env.ANDROID_HOME}/cmdline-tools`;

if (fs.existsSync(cmdlineToolsPath)) {
await io.rmRF(cmdlineToolsPath);
}
if (!fs.existsSync(cmdlineToolsPath)) {
console.log('Installing new cmdline-tools.');
const sdkUrl = isOnMac ? CMDLINE_TOOLS_URL_MAC : CMDLINE_TOOLS_URL_LINUX;
Expand All @@ -36,6 +32,7 @@ export async function installAndroidSdk(apiLevel: string, target: string, arch:
core.addPath(`${cmdlineToolsPath}/latest:${cmdlineToolsPath}/latest/bin:${process.env.ANDROID_HOME}/platform-tools`);

// set standard AVD path
await io.mkdirP(`${process.env.HOME}/.android/avd`);
core.exportVariable('ANDROID_AVD_HOME', `${process.env.HOME}/.android/avd`);

// accept all Android SDK licenses
Expand Down

0 comments on commit 48163f3

Please sign in to comment.