Created
June 15, 2017 06:57
-
-
Save michaeljymsgutierrez/d3f94d8f29398b51477e51f53ee9a59c to your computer and use it in GitHub Desktop.
Simple db pull through adb shell
This file contains 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 | |
# PACKAGE NAME | |
PACKAGE = com.companyname.appname | |
# DATABASE NAME | |
DB = db_app.db | |
# COPY ON ADB == cat | |
# If permission denied, change /sdcard to /storage/sdcard(#) | |
adb shell "run-as $PACKAGE cat /data/data/$PACKAGE/databases/$DB > /sdcard/$DB" | |
# Pull database | |
# If permission denied, change /sdcard to /storage/sdcard(#) | |
adb pull /sdcard/$DB | |
# 100% will display if successfull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment