Android源码下载方法

来源:互联网 发布:北京java语言培训 编辑:程序博客网 时间:2024/04/29 03:35

1、在下载源码之前需要安装如下软件包:
sudo apt-get install git-core
sudo apt-get install gnupg
sudo apt-get install sun-java6-jdk
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install gperf
sudo apt-get install libsdl-dev
sudo apt-get install libesd0-dev
sudo apt-get install build-essential
sudo apt-get install zip
sudo apt-get install curl
sudo apt-get install libncurses5-dev
sudo apt-get install zlib1g-dev

 

2、登陆source.android.com,然后进入Source——》Downloading the Source见下载步骤。

 

3、解决repo init -u https://android.googlesource.com/plat-form/manifest出现的报错:IOError: .repo/manifests/.git/HEAD'

$ touch ~/.gitconfig
$ rm -rf .rep

 

4、解决repo sync无法同步的报错:

A. 浏览器登录https://android.googlesource.com/new-password,并用gmail帐号登录;

B. 点击网页上的“允许访问”,得到类似:

machine android.googlesource.com login git-<userName>.gmail.com password <password> 
machine android-review.googlesource.com login git-<userName>.gmail.com password <passw
的信息。

C. 把上面那段信息(<userName>和<password>用自己得到的真实信息)追加到~/.netrc文件结尾;

D. 下载地址的URI更改为https://android.googlesource.com/a/platform/manifest(中间加上了“/a”)。
然后按照官网描述的正常步骤操作,即可下Android源码。