How can one pull the (private) data of one's own Android app?
adb backup will write an Android-specific archive:
adb backup -f myAndroidBackup.ab com.corp.appName
This archive can be converted to tar format using:
dd if=myAndroidBackup.ab bs=4K iflag=skip_bytes skip=24 | openssl zlib -d > myAndroidBackup.tar
Reference:
http://nelenkov.blogspot.ca/2012/06/unpacking-android-backups.html
Search for "Update" at that link.
Alternatively, use Android backup extractor to extract files from the Android backup (.ab
) file.
I had the same problem but solved it running following:
$ adb shell
$ run-as {app-package-name}
$ cd /data/data/{app-package-name}
$ chmod 777 {file}
$ cp {file} /mnt/sdcard/
After this you can run
$ adb pull /mnt/sdcard/{file}
Here is what worked for me:
adb -d shell "run-as com.example.test cat /data/data/com.example.test/databases/data.db" > data.db
I'm printing the database directly into local file.