国内android aosp源代码下载方法

 $git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/

$vim git-repo/repo

将     REPO_URL = 'https://gerrit.googlesource.com/git-repo'

修改为 REPO_URL = 'git://aosp.tuna.tsinghua.edu.cn/android/git-repo'

$export PATH=~/git-repo/:$PATH

$mkdir google_aosp

$cd google_aosp/

$repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.0.0_r1

$vim sync_repo.sh

内容如下:

#!/bin/bash
export PATH=~/git-repo/:$PATH
repo sync -f -j4
while [ $? == 1 ]; do
 sleep 3
 repo sync -f -j4
done

$chmod 777 sync_repo.sh

$./sync_repo.sh

If everything is OK, generates the following output to indicate the successful:
Syncing work tree: 100% (507/507), done.
$git --git-dir .repo/manifests/.git/ branch -a
$repo start android-7.0.0_r1--all
Starting android-7.0.0_r1: 100% (507/507), done.
$repo branches
*  android-7.0.0_r1         | in all projects

$repo start android-7.0.0_r1 --all

$repo checkout android-7.0.0_r1 

 

$mv .repo ../
$cd google_aosp
$find ./ -name .git |xargs rm -fr
$git init
$git add ./
$git commit -am "Google aosp android-7.0.0_r1"

 

附1:对于已从Google下载的源码,可以通过修改代码目录中的 .repo/manifest.xml 文件,https://android.googlesource.com改从清华的源同步git://aosp.tuna.tsinghua.edu.cn/android/。

posted @ 2015-11-24 11:31  thjfk  阅读(1467)  评论(0编辑  收藏  举报