Android 4.4源码下载与编译

这篇文章记录了我下载源码和编译的全过程, 全过程参考Android官方文档

1. 下载Android源码

1.1 安装repo

$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

1.2 初始化repo客户端

$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ repo init -u https://android.googlesource.com/platform/manifest
WORKING_DIRECTORY是你用来存储Android源码的文件夹。 此外如果需要下载分支需要使用-b选项,如下:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1

1.3 下载Android源码

$ repo sync

经过一段时间的等待,Android的源码就下载到本地了。

 

2. 编译源码

2.1 初始化环境

$ source build/envsetup.sh

2.2 选择目标平台与编译版本

$ lunch aosp_arm-eng

2.3 编译

$ make -j4

现在就可以去休息休息了。 很幸运, 一次成功,没有任何错误

 2.4 运行

$ emulator

Refs:

http://source.android.com/source/downloading.html

http://source.android.com/source/building-running.html

posted @ 2014-02-15 21:14  ZHX_1Q89  阅读(1364)  评论(0编辑  收藏  举报