1.工具位置
lint 工具在安卓 sdk 的 tools 目录下
2. lint使用
1>在命令行窗口 输入lint,得到lint 帮助说明如下:
Usage: lint [flags] <project directories>
Flags:
--help This message.
--help <topic> Help on the given topic, such as "suppress".
--list List the available issue id's and exit.
--version Output version information and exit.
--exitcode Set the exit code to 1 if errors are found.
--show List available issues along with full explanations.
--show <ids> Show full explanations for the given list of issue id's.
Enabled Checks:
--disable <list> Disable the list of categories or specific issue id's. The list should be a comma-separated list of issue id's or categories.
--enable <list> Enable the specific list of issues. This checks all the default issues plus the specifically enabled issues. The list should be a comma-separated list of issue id's or categories.
--check <list> Only check the specific list of issues. This will disable everything and re-enable the given list of issues. The list should be a comma-separated list of
issue id's or categories.
-w, --nowarn Only check for errors (ignore warnings)
-Wall Check all warnings, including those off by default
-Werror Treat all warnings as errors
--config <filename> Use the given configuration file to determine whether issues are enabled or disabled. If a project contains a lint.xml file, then this config file will be used as a fallback.
Output Options:
--quiet Don't show progress.
--fullpath Use full paths in the error output.
--showall Do not truncate long messages, lists of alternate locations, etc.
--nolines Do not include the source file lines with errors in the output. By default, the error output includes snippets of source code on the line containing the
error, but this flag turns it off.
--html <filename> Create an HTML report instead. If the filename is a directory (or a new filename without an extension), lint will create a separate report for each scanned project.
--url filepath=url Add links to HTML report, replacing local path prefixes with url prefix. The mapping can be a comma-separated list of path prefixes to correspondingURL prefixes, such as C:\temp\Proj1=http://buildserver/sources/temp/Proj1. To turn off linking to files, use --url none
--simplehtml <filename> Create a simple HTML report
--xml <filename> Create an XML report instead.
Project Options:
--resources <dir> Add the given folder (or path) as a resource directory for the project. Only valid when running lint on a single project.
--sources <dir> Add the given folder (or path) as a source directory for the project. Only valid when running lint on a single project.
--classpath <dir> Add the given folder (or jar file, or path) as a class directory for the project. Only valid when running lint on a single project.
--libraries <dir> Add the given folder (or jar file, or path) as a class library for the project. Only valid when running lint on a single project.