I have a script used to create android emulators for automated testing purposes, which looks more or less as follows:
ANDROID_API_LEVEL=${1:-34}
DEVICE_NAME=${2:-TestEmulator}
SDK_NAME="system-images;android-$ANDROID_API_LEVEL;google_apis_playstore;$MACHINE_ARCH"
EMULATOR_SPEC="medium_phone"
EMULATOR_AMOUNT_PER_MACHINE=${3:-1}
INCREMENT=1
# Create required emualtors
while [ $INCREMENT -le $EMULATOR_AMOUNT_PER_MACHINE ]; do
echo "Creating Emulator $INCREMENT"
echo no | avdmanager create avd -n "$DEVICE_NAME$INCREMENT" -k $SDK_NAME -d $EMULATOR_SPEC -f
echo "Successfully created "$DEVICE_NAME$INCREMENT
emulator @"$DEVICE_NAME$INCREMENT" -accel auto -no-snapshot -memory 5000 -noaudio &
((INCREMENT++))
done
Because the emulator was pretty laggy on my x86 Mac, I added the -memory
argument you can towards the bottom, however after inspecting the created emulator I noticed that the argument was completely ignored.
On the official android website the definition for the argument is defined as “Specifies the physical RAM size, from 1536 to 8192 MBs”
As can be seen here, the RAM is not 5000 as I inputted but 1536