Can anyone tell me, is it possible to use the ADB to pull and push a database from an app, without root privileges on the phone?
For example, I know the location on
On OxygenOS
(based on Android 5.2) I've mixed up the two solutions provided by Pilot_51
.
First I've used run-as
to gain access on /data/data/package.name/databases
from here I wasn't able to copy directly on /sdcard/
hence I changed the permission of the file. After that I've exited from run-as
mode and used cp
to copy the file in /sdcard/
storage. Eventually I was able to use adb pull
$ adb -s shell
$ run-as package.name
$ chmod 666 databases/dbname.db
$ exit
$ cp /data/data/package.name/databases/dbname.db /sdcard/dbname.db
$ exit
$ adb pull /sdcard/dbname.db ./dbname.db