Android ADB access to application databases without root

后端 未结 5 775
难免孤独
难免孤独 2020-12-02 05:20

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

5条回答
  •  悲&欢浪女
    2020-12-02 05:40

    A quick workaround is to use the run-as command to copy the database in a folder where you can have access, such as /sdcard and then, do a normal adb pull

    adb shell
    $ run-as package.name cp /data/data/package.name/dbname.db /sdcard/
    $ exit
    adb pull /sdcard/dbname.db
    

    More information on the run-as command here

    Note that the run-as command is available since API level 8 (Android 2.2) and can only be used if the application is debbugable.

提交回复
热议问题