Search code examples
androidadb

Can't pull database file from Android phone on 5.1


I have a non-rooted Nexus 5 on Android 5.1. I've tried multiple solutions described here Android ADB access to application databases without root in order to pull a debugable app database from the file system, but to no avail. Has anybody managed to make it work on 5.1 ?

When trying to copy to sdcard, I get cp: /sdcard: Permission denied

When trying to pull the file directly, I get remote object '/data/data/packagename/databases/name.db' does not exist


Solution

  • This question has been successfully answered by Alex P here - android adb, retrieve database using run-as

    Here's a quick look at the answer:

    the command for Android 5.0+ to save /data/data/package.name/databases/file would be:

    adb exec-out run-as package.name cat databases/file > file