View an app's internal data on a device

suggest change

First, make sure your app can be backed up in AndroidManifest.xml, i.e. android:allowBackup is not false.

Backup command:

adb -s <device_id> backup -noapk <sample.package.id>

Create a tar with dd command:

dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" > backup.tar

skip=24 matches the classic unencrypted compressed header: ANDROID BACKUP plus a newline, then 1, 1, and none, each followed by a newline. A different backup version or an encrypted header is longer, so that skip is wrong for those files. The Python one-liner is Python 2. On Python 3, sys.stdout.write cannot write the decompressed bytes.

Extract the tar:

tar -xvf backup.tar

You may then view the extracted content.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents