Android Backups - CraigDonkin/Android-Testing GitHub Wiki

There are multiple different backup techniques:

  • USB
  • Google Cloud
  • 3rd Party

Is app data stored in a backup?

  • Check the androidmanifest.xml for allowBackup .
  • From API 23+ this defaults to true if omitted
  • When true it means the app can be backed up
  • If the device is encrypted , the backup will be encrypted too

AutoBackup

  • Autobackup is also configured in the àndroidmanifest.xml
  • Apps that target API 23+ automatically participate in autobackup
  • Autobackup uploads app data to the users google drive account
  • 25MB per user of the app
  • Includes, shared prefs, internal storage, databases, external storage
  • android:allowBackup must be false to disable.

Backup Rules

  • Rules can be configured to only backup parts of an application as part of autobackup
  • defined in androidmanifest.xml
  • XML file will reside in res/xml directory

Taking a backup

adb backup -apk -nosystem com.your.app

dd if=mybackup.ab bs=24 skip=1 | openssl zlib -d > mybackup.tar

tar xvf mybackup.tar 

Restoring a backup

adb restore mybackup.ab