Skip to content

Instantly share code, notes, and snippets.

@michaeljymsgutierrez
Created June 15, 2017 06:57
Show Gist options
  • Save michaeljymsgutierrez/d3f94d8f29398b51477e51f53ee9a59c to your computer and use it in GitHub Desktop.
Save michaeljymsgutierrez/d3f94d8f29398b51477e51f53ee9a59c to your computer and use it in GitHub Desktop.
Simple db pull through adb shell
#!/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