好记性不如铅笔头

android, linux, 操作系统

Android源码编译简单记录

继【 Android源码下载简单记录 】下载好之后,就可以编译了,这里笔记一份最简单的编译流程。详细的参数参考【 官网 】。

CONTENTS

启用缓存

cstriker1407@cstriker1407-x64:~$ cd ~
cstriker1407@cstriker1407-x64:~$ gedit .bashrc 

#在bash文件的最后加入命令
export USE_CCACHE=1

cstriker1407@cstriker1407-x64:~$ source .bashrc
cstriker1407@cstriker1407-x64:~$ cd androidsource/
#作者编译的是5.0,因此输入命令如下:
cstriker1407@cstriker1407-x64:~/androidsource$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
Set cache size limit to 50.0 Gbytes

编译和启动

cstriker1407@cstriker1407-x64:~/androidsource$ . build/envsetup.sh

#编一个全功能的
cstriker1407@cstriker1407-x64:~/androidsource$ lunch aosp_arm-eng
cstriker1407@cstriker1407-x64:~/androidsource$ make
cstriker1407@cstriker1407-x64:~/androidsource$ emulator
#通过下面的命令定时查看缓存使用情况
watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s

备注

作者这里只是简单的笔记了最基本的流程,很多优化(make 的多线程,emulator的设置)都没有笔记。后续在专门笔记把。

发表评论

1 × 4 =

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据