How to test your android app works when the disk is full

Standard

It's very common that mobile users fill the disk, so your app needs to deal with situation checking whether it can store the data needed to run.

Here you are the steps needed to fill the disk quick:

  • open Android Studio
  • navigate to Tools > AVD Manager
  • create a device and run it
  • connect to the virtual device in a shell: $ adb shell
  • switch to root user: $ su
  • check disk space: $ df | grep data
  • $ cd /storage/self/primary
  • create a for e.g a 600MB file to fill the disk: $ dd if=/dev/zero of=big.file bs=1047552 count=600
  • use a bigger size if your virtual device has a bigger storage
  • launch and test your app

Leave a Reply

Your email address will not be published. Required fields are marked *