How do I view Android application specific cache?

后端 未结 7 1309
滥情空心
滥情空心 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条回答
  •  春和景丽
    2020-12-23 18:53

    Unless ADB is running as root (as it would on an emulator) you cannot generally view anything under /data unless an application which owns it has made it world readable. Further, you cannot browse the directory structure - you can only list files once you get to a directory where you have access, by explicitly entering its path.

    Broadly speaking you have five options:

    • Do the investigation within the owning app

    • Mark the files in question as public, and use something (adb shell or adb pull) where you can enter a full path name, instead of trying to browse the tree

    • Have the owning app copy the entire directory to the SD card

    • Use an emulator or rooted device where adb (and thus the ddms browser's access) can run as root (or use a root file explorer or a rooted device)

    • use adb and the run-as tool with a debuggable apk to get a command line shell running as the app's user id. For those familiar with the unix command line, this can be the most effective (though the toolbox sh on android is limited, and uses its tiny vocabulary of error messages in misleading ways)

提交回复
热议问题