How to change the RAM size of the Android emulator from the command line?

I want to edit or resize ram when creating android emulator from command line.

EX: when creating an emulator, it assumes the default spread size (Android SDK 4.0.3) 512 MB But I want to increase it to 768 MB or reduce it to 256 MB.

I want to change only the size of the Ram. Because it is possible to resize the frame.

Do you wish to create a custom hardware profile [no] Yes 

If you entered yes, we need to provide so many things.

+7
source share
3 answers

You need to find the configuration file for the created AVD.

In my case, I run AVD on Ubuntu, so here I found the configuration file.

 ~/.android/avd/emulator.avd/config.ini 

"emulator" is the name that I provided when creating the AVD, so the directory name will depend on what you provided.

The following is in 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 the heap size from 24 to 64 and added a ram size parameter.

For a list of options you can add, see Manage AVD from the command line.

+12
source

To answer the question in the title,

how to resize android emulator buffer size from command line?

you need to use the -memory option:

 emulator -memory 768 -avd <AVD_NAME> 

or

 emulator -memory 256 -avd <AVD_NAME> 
+5
source

You can change the default value of hw.ramSize in the hardware.ini that you use. For example, if you change platforms/android-15/skins/**WVGA800**/hardware.ini to

 hw.lcd.density=240 vm.heapSize=48 hw.ramSize=1024 

Then you can create avd with 1024 M RAM using:

 android create avd -f -t <target> -s **WVGA800** -n test_avd 
+2
source

All Articles