Google的官网上对此已经有了流程介绍。以下是经过我实践过的下载过程,并配有翻译。
1.Make sure you have a bin/ directory in your home directory, and that it is included in your path:
(建立bin目录,关联path)
$ mkdir ~/bin
$ PATH=~/bin:$PATH
2.Download the Repo script and ensure it is executable:
(下载repo,并修改权限)
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
3.Create an empty directory to hold your working files.
(建立下载目录,并进入到目录中)
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
4.Run repo init
to bring down the latest version of Repo with all its most recent bug fixes.. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
(执行repo init获取android版本列表)
$ repo init -u https://android.googlesource.com/platform/manifest
http://source.android.com/source/build-numbers.html
5.To check out a branch other than "master", specify it with -b:
(初始化下载对应版本)
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
6.To pull down files to your working directory from the repositories as specified in the default manifest, run
(开始下载)
$ repo sync
源码的编译可以参考: