Android 编译命令 envsetup.sh

本文介绍了Android应用程序的模块化编译方法,包括如何使用特定命令编译指定目录下的所有模块,以及如何重新生成system.img文件。通过这些命令,开发者可以更高效地进行Android系统的定制与开发。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译模块

Android中的一个应用程序可以单独编译,编译后需要重新生成system.img。
在Android目录下运行
$ . build/envsetup.sh  或者
$ source 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.
- printconfig: 当前build的配置情况.
可以使用 --help查看用法。
如:在修改了某一个模块以后,可以使用 $ mmm <目录>  来重新编译所有在<目录>中的所有模块,使用 $ mm  编译当前目录中的所有模块。
编完之后,即修改了Android系统以后,可以使用 $ make snod 重新生成system.img

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值