国内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/。

转载于:https://www.cnblogs.com/thjfk/p/4991064.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值