Created
August 13, 2014 10:30
-
-
Save lifecube/b8390a5290e272fe5f25 to your computer and use it in GitHub Desktop.
pull out android db file to current folder
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
| ADB="/Applications/Android\ Studio.app/sdk/platform-tools/adb" | |
| ADB_SHELL="$ADB shell" | |
| SELF=`basename $0` | |
| DEST_DIR="./" | |
| if [ $# -ne 2 ] | |
| then | |
| echo "Usage: $SELF [PACKAGE.NAME [DB_FILE]]" | |
| echo "eg. $SELF com.mydomain.myapp names.db" | |
| exit 0 | |
| fi; | |
| cmd_chmod="$ADB_SHELL 'run-as $1 chmod 666 /data/data/$1/databases/$2' " | |
| cmd_pull="$ADB pull /data/data/$1/databases/$2 $DEST_DIR" | |
| eval $cmd_chmod | |
| eval $cmd_pull | |
| err=$? | |
| if [ $err -eq 0 ] | |
| then | |
| echo "Done: ADB pull" | |
| else | |
| echo "Failed: ADB pull" | |
| exit err | |
| fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment