How to change the android emulator RAM size from the command line?

前端 未结 3 1354
感动是毒
感动是毒 2020-12-06 02:25

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 S

相关标签:
3条回答
  • 2020-12-06 02:42

    To answer the question in the title,

    how to change the android emulator ram size from command line?

    one has to use -memory option:

    emulator -memory 768 -avd <AVD_NAME>
    

    or

    emulator -memory 256 -avd <AVD_NAME>
    
    0 讨论(0)
  • 2020-12-06 02:51

    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

    0 讨论(0)
  • 2020-12-06 02:53

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

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

    Then you can create an avd that has 1024M of ram by using:

    android create avd -f -t <target> -s **WVGA800** -n test_avd
    
    0 讨论(0)
提交回复
热议问题