更新到ADT 16和使用Android Lint。这真是令人惊叹的工具。
Android Lint是ADT 16(和工具16)的新工具,它扫描Android项目源以查找潜在的错误。
Here are some examples of the types of errors that it looks for:
- 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
and many more.
你可以试试这个[PROGRAMM(https://github.com/matzuk/RemovingAndroidUnusedResources)的Android项目 –