查找出来,如果​​资源被使用资源

2023-09-03 20:29:44 作者:假情假意假人心べ

我要寻找一种有效的方式,以找出是否一个资源(主要是被拉伸)是用JAVA或XML文件中。

I am looking for an efficient way to find out if a resource (mostly a drawable) is used in java or in an XML file.

的问题是,在我的当前项目的可绘制经常改变,现在我有一些可绘,可能永远不会被使用。

The problem is, that on my current project the drawables are changed often and now I have some drawables, which might never be used.

有没有一种工具/方法来找到那些未使用的可绘而不搜索每个文件名,在整个项目?

Is there a tool/way to find those unused drawables without search each filename in the whole project?

推荐答案

我写了一个工具,基于Python来解决这个问题。由于这并非直接分享它的地方,我创建了一个项目页面,该页面现在处于脱机状态。

I wrote a tool based on python to solve this problem. As this is not the place to share it directly, I created a project page which is now offline.

更新: 开发自棉绒已经停止可以做同样的,并已经包含在Android SDK中。

UPDATE: The development has stopped since Lint can do the same and is already included in the Android SDK.