Add option to set AVD RAM size.

This commit is contained in:
Yang
2021-06-26 23:26:38 +10:00
parent 8a4333421e
commit eba1fbfb59
7 changed files with 22 additions and 2 deletions
+5
View File
@@ -12,6 +12,7 @@ export async function launchEmulator(
arch: string,
profile: string,
cores: string,
ramSize: string,
sdcardPathOrSize: string,
avdName: string,
forceAvdCreation: boolean,
@@ -35,6 +36,10 @@ export async function launchEmulator(
await exec.exec(`sh -c \\"printf 'hw.cpu.ncore=${cores}\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
}
if (ramSize) {
await exec.exec(`sh -c \\"printf 'hw.ramSize=${ramSize}\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
}
//turn off hardware acceleration on Linux
if (process.platform === 'linux' && disableLinuxHardwareAcceleration) {
console.log('Disabling Linux hardware acceleration.');
+5
View File
@@ -52,6 +52,10 @@ async function run() {
const cores = core.getInput('cores');
console.log(`Cores: ${cores}`);
// RAM to use for AVD
const ramSize = core.getInput('ram-size');
console.log(`RAM size: ${ramSize}`);
// SD card path or size used for creating the AVD
const sdcardPathOrSize = core.getInput('sdcard-path-or-size');
console.log(`SD card path or size: ${sdcardPathOrSize}`);
@@ -135,6 +139,7 @@ async function run() {
arch,
profile,
cores,
ramSize,
sdcardPathOrSize,
avdName,
forceAvdCreation,