android编译 filter
时间: 2023-08-03 08:08:01 浏览: 115
在Android编译过程中,filter(过滤)是一个常用的操作,用于选择要编译的特定模块或文件。通过使用filter,可以减少编译时间和生成的输出大小。
要在Android编译中使用filter,可以按照以下步骤进行操作:
1. 打开终端或命令提示符,并进入Android源码根目录。
2. 使用lunch命令选择要编译的目标设备。例如,使用以下命令选择编译Pixel 3设备:
```
$ lunch aosp_blueline-userdebug
```
3. 运行make命令来开始编译过程。在make命令中,可以使用以下参数来指定filter:
- `MODULES-INCLUDE=<模块1,模块2>`:指定要包含的模块列表。
- `MODULES-EXCLUDE=<模块1,模块2>`:指定要排除的模块列表。
- `TARGET_FILES=<文件1,文件2>`:指定要编译的特定文件列表。
例如,以下命令将只编译名为"Module1"和"Module2"的模块:
```
$ make MODULES-INCLUDE=Module1,Module2
```
或者,以下命令将编译除了名为"Module3"之外的所有模块:
```
$ make MODULES-EXCLUDE=Module3
```
还可以使用通配符来匹配多个模块或文件。例如,以下命令将编译所有以"Module_"开头的模块:
```
$ make MODULES-INCLUDE=Module_*
```
注意:filter参数的具体用法可能因不同的Android版本和构建系统而有所差异。请根据你使用的具体情况进行适当的调整。
通过使用filter,你可以选择性地编译Android源码中的模块或文件,以满足你的特定需求。这可以提高编译效率并减少生成的输出大小。
阅读全文
相关推荐
















