1 绪论
Android是一种基于 Linux 内核、自由开放源代码的操作系统, 由 Google 公司和开放手机联盟共同领导及开发, 主要使用于移动设备。首先就从系统源代码下载与编译过程分析开始。
2 编译环境搭建准备工作
(1) UbuntuKylin 16.04 LTS 链接内容
(2) Android 6.0_r1
(3) Open JDK 7
3 系统源码下载
(1) 安装git
安装好之后配置用户名和邮箱地址
$ sudo apt-get install git
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
(2) 安装curl
$ sudo apt-get install curl
(3) 下载repo
repo是google为方便管理android源码编写的一系列python脚本。
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
(4) 同步代码
创建存放源码的文件夹
$ mkdir android-6.0.1
$ cd android-6.0.1
使用repo init指定要同步的代码版本,目前所有android源码的版本:链接内容

最低0.47元/天 解锁文章
4567





