I want to edit or change the ram size while creating the android emulator from command line.
EX: While creating the emulator it's taking default ram size(Android SDK 4.0.3) 512 MB But I want to increase it to 768MB or decrease it to 256MB.
I want to change only Ram size. Because there is an option to change the Ram size.
Do you wish to create a custom hardware profile [no] Yes
If you entered yes, we need to provide so many things.
Go to Tools->Android->AVD Manager , there's something like pencil to edit your AVD click on that, then in the pop-up window click Show Advanced Settings and there you can change the RAM size.
On Android StudioClick Edit Icon to edit the AVD. Click Show Advanced settings. Change the Internal Storage, Ram, SD Card size as necessary. Click Finish.
However, the heap size should not be less than 12 MB. o Depending on your computer specs, the recommended ram size is in the range between 512 MB – 1024 MB. Although you can give more ram to the emulator but an actual android device would normally have 512 MB – 1024 MB for ram only.
You need to find the config file for the AVD that you have created.
In my case, I'm running the AVD on Ubuntu, so this is where I found the config file.
~/.android/avd/emulator.avd/config.ini
"emulator" was the name I provided when I created the AVD, so the directory name will depend on what you provided.
The following is what is inside the config.ini file:
hw.lcd.density=240
skin.name=WVGA800
skin.path=platforms/android-8/skins/WVGA800
hw.cpu.arch=arm
abi.type=armeabi
vm.heapSize=64
hw.ramSize=1024
image.sysdir.1=platforms/android-8/images/
I increased my heap size from 24 to 64, and added the ram size parameter.
For the list of parameters you can add, refer to: Managing AVDs from the Command-line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With