一、引言
在Android SDK源码工程下,如果编译整个工程可能需要两三个小时,即使二次编译也要二十多分钟。如果只想单独编译某个模块,则可以使用mm命令。
二、mm命令的使用
1、在Android源码根目录下,进入build目录下执行
. envsetup.sh
注意:
1. 命令前面有一个点,然后接一个“空格”键
2. 想在不同用户下使用mm命令,必须先切换到使用用户,执行该脚本。
执行完后,就会多出以下几个命令:
- croot: Changes directory to the top of the tree.
- m: Makes from the top of the tree.
- mm: Builds all of the modules in the current directory.
- mmm: Builds all of the modules in the supplied directories.
- cgrep: Greps on all local C/C++ files.
- jgrep: Greps on alllocal Java files.
- resgrep: Greps on all local res/*.xmlfiles.
- godir: Go to the directory containing afile.
- printconfig: 当前build的配置情况
2、mm命令
用于编译当前目录, 该目录下必须存在Android.mk文件。
3、mmm命令
用于编译指定目录,如:
mmmSettings
表示编译Settings这个目录,之后会生成新的apk