mirror of
https://github.com/reactivecircus/android-emulator-runner.git
synced 2026-09-04 03:19:33 +00:00
Add option to modify the number of cores
This commit is contained in:
@@ -10,6 +10,7 @@ export async function launchEmulator(
|
||||
target: string,
|
||||
arch: string,
|
||||
profile: string,
|
||||
cores: string,
|
||||
sdcardPathOrSize: string,
|
||||
avdName: string,
|
||||
emulatorOptions: string,
|
||||
@@ -23,6 +24,10 @@ export async function launchEmulator(
|
||||
`sh -c \\"echo no | avdmanager create avd --force -n "${avdName}" --abi '${target}/${arch}' --package 'system-images;android-${apiLevel};${target};${arch}' ${profileOption} ${sdcardPathOrSizeOption}"`
|
||||
);
|
||||
|
||||
if (cores) {
|
||||
await exec.exec(`sh -c \\"printf 'hw.cpu.ncore=${cores}\n' >> ~/.android/avd/"${avdName}".avd"/config.ini`);
|
||||
}
|
||||
|
||||
// start emulator
|
||||
console.log('Starting emulator.');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user