在源码目录下执行
. build/envsetup.sh (.后面有空格)
就多出一些命令:
- 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 all local Java files.
- resgrep: Greps on all local res/*.xml files.
- godir: Go to the directory containing a file.
可以加—help查看用法
可以使用mmm来编译指定目录的模块:
# mmm ./packages/apps/Settings/
或者在./packages/apps/Settings/ 目录下执行:
#mm
编译之后生成两个文件:
out/target/product/generic/data/app/Settingstests.apk
out/target/product/generic/system/app/ Contacts.apk
和各自的.odex文件,现在单独安装.apk文件还不成功,必须合并.apk和.odex文件。