Ubuntu下使用git和repo下载Android的源代码

转自:http://www.cnblogs.com/wanlipeng/archive/2010/08/26/1809215.html


1.安装git
sudo apt-get install git-core 

2.安装curl
sudo apt-get install git-core curl

3.安装Repo,为了方便直接下载repo到用户根目录中。通过curl下载repo
curl http://android.git.kernel.org/repo >~/repo

4.给repo可执行的权限
chmod a+x ~/repo

5.新建一个目录,然后进入该目录。通过repo将当前Android上所有源代码下载。
首先初始化本地,
~/repo init -u https://android.googlesource.com/platform/manifest
~/repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1

6.执行
repo sync

则自动开始下载源代码。
     通过以上方法可以下载到源代码,只是源代码比较大,如果网速不快的话,不建议这么做。而且下载过程中并不能看到下载的文件,需要所有的都下载完毕之后才能看到。这点有点不尽人意,而且git支持断点续传,如果中断了也不用担心。
     更多信息请参考:
     http://source.android.com/source/downloading.html

猜你喜欢

转载自shoukii0721.iteye.com/blog/1679241