Android 4.4 Virtual Device Internal Storage Will Not Resize

倖福魔咒の 提交于 2019-11-28 03:19:50

Now that the emulator file system is ext4 I was able to re-size the userdata.img using standard Linux tools.

# Navigate to AVD
cd ~/.android/avd/Nexus5
# Delete old image
rm userdata-qemu.*
# Re-size the image
resize2fs userdata.img 512M
# Start the emulator and enjoy
emulator @Nexus5

Edit I was also able to re-size userdata-qemu.img directly but I had to run e2fsck first.

 e2fsck -f userdata-qemu.img
 resize2fs userdata-qemu.img 512M

Even above suggestion can cause to android emulator hang on boot logo. The reason is that resize2fs do the changes thats are right in general but considered as broken fs by android and prevent it to mount it in rw mode, that hangs up the boot process.

Examening boot logs shows something like that:

EXT4-fs error (device mtdblock1): ext4_mb_generate_buddy:741: group 2, 32366 clusters in bitmap, 32370 in gd

Event e2fsck does not fix it for android and to workaround it i use tune2fs to change the way how android should continue to mount broken fs.

tune2fs -e continue userdata-qemu.img

Someone13, this is definitely a Bug in Target: "Android 4.4.2 - API Level 19"

I have the same problem- can’t change the size of internal storage of the device in emulator of Android SDK by no way(even with “disk.dataPartition.size=xxxM” in config.ini or with command-prompt arguments “-partition-size xxx”) when using Android 4.4.2 in the Emulator of Android SDK.

The only way is to set custom size is when using as Target: Android 3.0 - API Level 11.

My hardware: Windows 7 Ultimate SP1, RAM 4GB; Core Duo 2.28GHz; GT630

If you are still having this issue in 2016, try deleting the image from AVD manager, and then add back the emulator.

It seemed like I could not resize the emulator no matter what I do, but it worked when I deleted the image and then recreated image with 1GB internal storage.

I was able to create this virtual device, maybe change your device type or something?

To build up on @Frohnzie's answer, resize2fs and e2fsck are now included in the SDK Tools (you may need to update your SDK tools to see them) so you don't need to install them separately. They are located under yourAndroidSDKFolder/tools/bin (Windows, Linux) or yourAndroidSDKFolder/tools/bin64 (Mac, Linux).

Kanwaljit Singh

Assaf G.'s answer is good. But i have noticed in the following links in the first one user is able to create Emulator with internal storage 500MB. But he is getting some exceptions but not related to internal storage. And in the other link user able to create emulator with internal memory 4096MB. But he is facing speed problems. So i think you have to try with specifications provided in first link.

1.Android 4.4 Emulator

2.android emulator forever launching

For me it was an issue when I accidentally chose the AOSP 4.4.2 emulator in Android Studio. The Google Inc. x86 emulator (below) doesn't seem to have this bug.

delete /data/data/com.google.android.gms/files will release 200M+

Here, there seems to be some catch, in older android tools lower than version 22, this does not work. I upgraded the android tools to 23 and this started working.

My configuration was API Level 21 CPU: Intel X86 OS: Ubuntu Linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!