Skip to content

Commit 5f92008

Browse files
Add compiled JS files and remove standalone efficiency report
- Include built lib/emulator-manager.js with batched config optimization - Remove EFFICIENCY_REPORT.md as requested - Efficiency report content will be moved to PR description Co-Authored-By: Yang <[email protected]>
1 parent e13d505 commit 5f92008

File tree

2 files changed

+21
-73
lines changed

2 files changed

+21
-73
lines changed

EFFICIENCY_REPORT.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

lib/emulator-manager.js

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,27 @@ function launchEmulator(systemImageApiLevel, target, arch, profile, cores, ramSi
5050
console.log(`Creating AVD.`);
5151
yield exec.exec(`sh -c \\"echo no | avdmanager create avd --force -n "${avdName}" --abi '${target}/${arch}' --package 'system-images;android-${systemImageApiLevel};${target};${arch}' ${profileOption} ${sdcardPathOrSizeOption}"`);
5252
}
53-
if (cores) {
54-
yield exec.exec(`sh -c \\"printf 'hw.cpu.ncore=${cores}\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
55-
}
56-
if (ramSize) {
57-
yield exec.exec(`sh -c \\"printf 'hw.ramSize=${ramSize}\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
58-
}
59-
if (heapSize) {
60-
yield exec.exec(`sh -c \\"printf 'hw.heapSize=${heapSize}\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
61-
}
62-
if (enableHardwareKeyboard) {
63-
yield exec.exec(`sh -c \\"printf 'hw.keyboard=yes\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
64-
}
65-
if (diskSize) {
66-
yield exec.exec(`sh -c \\"printf 'disk.dataPartition.size=${diskSize}\n' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini`);
53+
if (cores || ramSize || heapSize || enableHardwareKeyboard || diskSize) {
54+
const configEntries = [];
55+
if (cores) {
56+
configEntries.push(`hw.cpu.ncore=${cores}`);
57+
}
58+
if (ramSize) {
59+
configEntries.push(`hw.ramSize=${ramSize}`);
60+
}
61+
if (heapSize) {
62+
configEntries.push(`hw.heapSize=${heapSize}`);
63+
}
64+
if (enableHardwareKeyboard) {
65+
configEntries.push('hw.keyboard=yes');
66+
}
67+
if (diskSize) {
68+
configEntries.push(`disk.dataPartition.size=${diskSize}`);
69+
}
70+
if (configEntries.length > 0) {
71+
const configContent = configEntries.join('\\n') + '\\n';
72+
yield exec.exec(`sh -c \\"printf '${configContent}' >> ${process.env.ANDROID_AVD_HOME}/"${avdName}".avd"/config.ini"`);
73+
}
6774
}
6875
// turn off hardware acceleration on Linux
6976
if (process.platform === 'linux' && disableLinuxHardwareAcceleration) {

0 commit comments

Comments
 (0)