Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get database from an Android app (Android 4.3+)
# Android 4.3+ changes app's internal directory permissions and you can not just pull your
# databases to your computer, so I did this as a workaround to extract my databases.
# I only use it for debug, use it under your responsability.
rm $db_name
adb shell "su -c 'cd $path; chmod -R 777 databases; exit'; exit"
adb pull $path/databases/$db_name
open $db_name

This comment has been minimized.

Copy link
Owner Author

ignasi commented Jan 30, 2014

BTW, requires root.


This comment has been minimized.

Copy link

santi-gonzalez commented Jan 30, 2014

As always, very useful!

Good job!


This comment has been minimized.

Copy link

BrandonSmith commented Mar 9, 2014

Possible way around root, if the app does not have debuggable=false, is to pipe the db file contents...


adb shell "run-as $package cat databases/$db_name > /sdcard/$db_name"
adb pull /sdcard/$db_name
open $db_name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.