Android test out of storage space
Android runs on linux, so you can go to the shell and use the dd
command to fill up the disk. Connect your device by USB and type adb shell
, then
dd if=/dev/zero of=/sdcard/deleteme bs=1m count=1024
write a 1GB file named deleteme
to the /sdcard
, full of zeroes.
if=
is the input file/dev/zero
just returns endless zeroes.of=
is the output filebs=
is the block size, here one megabyte; some implementations prefer1M
instead.count=
is the number of blocks to write, here 1024, which makes for a 1GB file.
Adjust the sizes to suit your needs, or write multiple files. Prepare for Android to start complaining about low disk space once you hit around 400MB available space. In my experience, Android start complaining about low disk space long before the apps begin to crash.
If you test your app on a AVD emulator, you can simply configure the space available in the emulator. See documentation. Let me know if that solution works for you.Here is your tutorial on how to use AVD for Google Play Services.