如何查看Android应用程序特定的缓存?缓存、应用程序、Android

2023-09-06 02:50:34 作者:毛骨悚男,)

有没有什么办法可以动态查看的Andr​​oid应用程序特定的缓存?我的图像保存到缓存(/数据/数据​​/ my_app_package /高速缓存),我99%肯定,他们正在保存在那里,但不知道他们是如何长时间呆在身边。

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 saving there, but not sure how long they're staying around.

当我看在使用DDMS文件资源管理器在Eclipse中的缓存,它总是空的。我也试着检查相应的缓存目录中的亚行,并再次,它总是空的。

When I look in the cache using the DDMS File Explorer within Eclipse, it's always empty. I've also tried examining the appropriate cache dir in ADB and again it's always empty.

有什么建议?

推荐答案

除非亚行以root权限运行(因为它会在一个模拟器),你一般不能查看下/数据任何东西,除非它拥有它的应用已经使它成为任何人可读。此外,您无法浏览目录结构 - 你可以只列出文件,一旦你,你有权限的目录,通过明确进入其路径

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

有拥有它的应用程序的整个目录复制到SD卡

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

使用模拟器或root权限的设备,其中亚洲开发银行(因而DDMS浏览器的访问权限)可以以root身份运行(或使用root文件资源管理器或根设备)

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)

使用亚行和运行的工具,一个调试的APK得到一个命令行shell中运行的应用程序的用户ID。对于那些熟悉U​​NIX命令行,这可能是最有效的(尽管在Android上的工具箱SH是有限的,并使用其微小的错误消息的词汇误导方式)

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)