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

后端 未结 12 2383
清酒与你
清酒与你 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:29

    Steps to pull app db(installed in debug mode) from device

    Close DB connection if opened

    Open cmd (command prompt) (Change dir to your adb path)

    cd C:\Program Files (x86)\Android\android-sdk\platform-tools

    (list the app files)

    adb -d shell "run-as com.xyz.name ls /data/data/com.xyz.name/files/"

    (copy required file to sdcard)

    adb -d shell "run-as com.xyz.name cp /data/data/com.xyz.name/files/abc.db /sdcard/abc.db"

    (copy from sdcard to machine adb folder)

    adb pull /sdcard/abc.db

    Open DB connection

    Destination file path in my case C:\Users{userName}\AppData\Local\VirtualStore\Program Files (x86)\Android\android-sdk\platform-tools Or Device storage

提交回复
热议问题