然而,这不是一个逻辑问题,我仍然很想知道我是否有任何在我的项目中没有使用的空闲文件。有时在一个漫长的项目之后,我们只是不知道哪个是实际文件,哪个是它的副本。有时我们只是创建一些 xml 文件来检查布局和其他效果,例如选择器或一些自定义可绘制对象。我的意思是,尽管这些文件永远不会被执行,但当我们回到有关真实身份的代码时,它会造成逻辑困惑以及文件的使用。
我读到 Proguard 在制作 apk 文件之前会删除所有未使用的文件。它也会删除所有这些 xml 文件吗?
我对 proguard 概念有点陌生。 谢谢。
最佳答案
您可以使用 AndroidLint,该工具会扫描您的项目并返回大量建议,然后返回所有未使用的资源!
http://tools.android.com/tips/lint
- Missing translations (and unused translations)
- Layout performance problems (all the issues the old layoutopt tool used to find, and more)
- Unused resources
- Inconsistent array sizes (when arrays are defined in multiple configurations)
- Accessibility and internationalization problems (hardcoded strings, missing contentDescription, etc)
- Icon problems (like missing densities, duplicate icons, wrong sizes, etc)
- Usability problems (like not specifying an input type on a text field)
- Manifest errors
关于android - 有什么方法可以知道哪个xml文件没有在我们的项目中使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17544246/