Skip to content

Instantly share code, notes, and snippets.

@fuho
Created January 26, 2015 16:18
Show Gist options
  • Save fuho/e3ab24ad457b7f374ad3 to your computer and use it in GitHub Desktop.
Save fuho/e3ab24ad457b7f374ad3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Setup
PACKAGE_NAME="###################################################"
DB_PATH="/data/data/$PACKAGE_NAME/databases"
DB_FILENAME="####################################################"
#cleanup after old runs(just in case)
adb shell "su -c \"rm /sdcard/$DB_FILENAME\""
adb shell "su -c \"cp $DB_PATH/$DB_FILENAME /sdcard/\""
DATETIME=$(date +%Y-%m-%d@%H-%M-%S)
LOCAL_PATH=/tmp/adb_db_pulls/$DATETIME_$DB_FILENAME
adb pull /sdcard/$DB_FILENAME $LOCAL_PATH
#cleanup
adb shell "su -c \"rm /sdcard/$DB_FILENAME\""
sqlitebrowser $LOCAL_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment