Created
October 13, 2016 01:09
-
-
Save macu/94d9fc07069c63ee85e391d531a4daa3 to your computer and use it in GitHub Desktop.
Copy database from actual device to VM for testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ensure all AVDs are closed, and your Android device is connected. | |
# To make a backup of the ca.mattcudmore.day2day app: | |
~/Library/Android/sdk/platform-tools/adb backup -f backup.ab ca.mattcudmore.day2day | |
# Convert the backup file to TAR: | |
dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" > backup.tar | |
# Extract the TAR to access files. | |
tar -xvf backup.tar | |
# Now disconnect Android device and launch AVD where files will be copied to. | |
# For copying a database file from the extracted TAR into place, for example: | |
~/Library/Android/sdk/platform-tools/adb push example.db /data/data/ca.mattcudmore.day2day/databases/example.db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment