Last active
August 29, 2015 14:27
-
-
Save mohoff/ae6ec5478a2657c78266 to your computer and use it in GitHub Desktop.
Script to pull a database file from an Android phone and open it with sqlitebrowser on Ubuntu. Phone needs to be rooted. Edit default filename and packagename as needed. Check if tools sqlitebrowser and adb are installed (latter should be able to connect to your phone). Not sure if it also works with an emulator.
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
#!/bin/sh | |
set -e | |
filename="database.db" | |
packagename="de.mohoff.zeiterfassung" | |
if [ "$#" -eq 2 ] | |
then | |
filename="$1" | |
packagename="$2" | |
fi | |
adb shell "su -c 'chmod 777 /data /data/data /data/data/$packagename /data/data/$packagename/databases /data/data/$packagename/databases/$filename; | |
cp /data/data/$packagename/databases/$filename /sdcard'" | |
adb pull /sdcard/$filename | |
adb shell "rm -f /sdcard/$filename" | |
sqlitebrowser $filename | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment