[Android] How to Set the Partition Size for Android Emulator as Default?
In the Set the Partition Size for Android Emulator, I explain that how to set the partition size for Android emulator. But, in that way, you should execute the emulator on the command line rather than AVD manager. It’s not convenient to developer who is programming on Eclipse.
In this article, I will explain how to set the partition size for AVD as default. By this way, developers do not need to execute the emulator on the command line every time.
It is very easy to resize the system/data partition. The steps show on below,
Step 1: Create the new AVD
In the Eclipse, go to the Window>AVD Manager. You can done this step by the AVD manager. For this example, I create a AVD which is named android-2.3.3.
Step 2: Modify the config file to define the new partition size for AVD
You can find out the config file in the directory “~/.android/avd/android-2.3.3.avd/config.ini“. In the file “config.ini”, you should add the new setting “disk.dataPartition.size=128“. The “disk.dataPartition.size” means the partition size of data. In this example, we give 128MB for the partition.
Otherwise, if you want to resize the system partition, you should give the setting “disk.systemPartition.size“.
Step 3: Restart the android-2.3.3 AVD
We can see the size of data partition through the command “adb shell df“.
In this article, we can through the approach to resize the partition in the Android emulator. We don’t need to give the partition size on the command line every time. The file “config.ini” helps we to set the partition size for AVD. We just need to create a new AVD and to set a new value to the disk partition. Finally, the size of the data partition in the AVD that can be changed.
This does not work as described. Setting the system partition size parameter to:
still ends up with Eclipse starting the emulator with zero free space on /system
Same holds true if I try adding a m or MB suffix to the parameter value.
Same holds true if I try using disk.partition.size as the parameter name.
Yes, I also found out this problem. It seems like a bug in qemu for Android. I am trying to solve this problem. Thanks for your feed back!
How to resize system partition in AVD then?
It sets it to the system.img file size.
It's possible to copy platform tools system.img to custom location and increase it's size with resize2fs tool