Retrieve database or any other file from the Internal Storage using run-as

后端 未结 12 2329
清酒与你
清酒与你 2020-11-22 11:01

On a non-rooted android device, I can navigate to the data folder containing the database using the run-as command with my package name. Most files types I am c

12条回答
  •  温柔的废话
    2020-11-22 11:24

    I couldn't get anything else to work for me but this:

    adb shell
    run-as package.name
    cat /databases/databaseFileName.db > /sdcard/copiedDatabaseFileName.db
    exit
    exit
    adb pull /sdcard/copiedDatabaseFileName.db /file/location/on/computer/
    

    The first exit is to exit out of the run-as, the second exit is to exit out of adb shell to do the pull.

提交回复
热议问题