mirror of
https://github.com/reactivecircus/android-emulator-runner.git
synced 2026-11-02 17:25:50 +00:00
Add option to set AVD RAM size.
This commit is contained in:
1 parent
8a4333421e
commit
eba1fbfb59
7 files changed
+22
-2
No files matched your search
@@ -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.');
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user