1 cd candroid
2 编译整个系统
2.1 . (注意空格 ) build/envsetup.sh
该语句等效于 source /build/envsetup.sh.(source fileName)他配置了Android编译环境,可以在当前的bash环境下使用并执行build/envsetup.sh中的命令
如:source .bash_rc 与 . .bash_rc 是等效的。
source 命令和shell脚本的区别是:
source 在当期bash环境在执行,而shell 脚本是启动一个子shell 來执行。
所以如果把设置环境变量的命令写在shell 脚本中,就会影响子shell脚本的执行,无法修改环境变量。
所以通过文件来设置环境变量
lunch aosp_hammerhead-eng
2.2 lunch 选择编译平台 ( xxx-架构-工程机/调试机/用户机)
1. aosp_arm-eng
2. aosp_x86-eng
3. aosp_mips-eng
4. vbox_x86-eng
5. mini_mips-userdebug
6. mini_armv7a_neon-userdebug
7. mini_x86-userdebug
8. aosp_mako-userdebug
9. aosp_mako-eng
10. aosp_hammerhead-userdebug
11. aosp_hammerhead-eng
12. aosp_manta-userdebug
13. aosp_deb-userdebug
14. aosp_grouper-userdebug
15. aosp_tilapia-userdebug
16. aosp_flo-userdebug
3 make update-api
// 如果在framework中添加了自定义的公共资源,则需要运行该行,否则不需要
// 之前长时间没有更新代码,更新代码后,需要运行该行,因为别的同事可能在framework中加资源和接口了