How do I view Android application specific cache?

后端 未结 7 1313
滥情空心
滥情空心 2020-12-23 18:43

Is there any way to dynamically view the application specific cache in Android? I\'m saving images to the cache (/data/data/my_app_package/cache) and I\'m 99% sure they\'re

7条回答
  •  梦毁少年i
    2020-12-23 18:52

    You may use this command for listing the files for your own debuggable apk:

    adb shell run-as com.corp.appName ls /data/data/com.corp.appName/cache
    

    And this script for pulling from cache:

    #!/bin/sh
    adb shell "run-as com.corp.appName cat '/data/data/com.corp.appNamepp/$1' > '/sdcard/$1'"
    adb pull "/sdcard/$1"
    adb shell "rm '/sdcard/$1'"
    

    Then you can pull a file from cache like this:

    ./pull.sh cache/someCachedData.txt
    

    Root is not required.

提交回复
热议问题