Created
October 1, 2015 15:52
-
-
Save xgouchet/8a14513f8e66490163fd to your computer and use it in GitHub Desktop.
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
# Usually I just include that in my ~/.bashrc | |
# Usage : adb_pull_db_pre_lollipop com.package.name file.db | |
function adb_pull_db_pre_lollipop () { | |
if [[ -z "$1" ]]; then | |
echo "Usage : adb_pull_db_pre_lollipop com.package.name file.db" | |
exit 1 | |
fi | |
adb shell "run-as $1 chmod 666 /data/data/$1/databases/$2" | |
adb pull /data/data/$1/databases/$2 . | |
adb shell "run-as $1 chmod 600 /data/data/$1/databases/$2" | |
} | |
# Usage : adb_pull_db com.package.name file.db | |
function adb_pull_db () { | |
if [[ -z "$1" ]]; then | |
echo "Usage : adb_pull_db_pre_lollipop com.package.name file.db" | |
exit 1 | |
fi | |
adb exec-out "run-as $1 cat /data/data/$1/databases/$2" > $2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment