AOSP源码下载

AOSP源码下载

一、Android源码传统方式下载操作

1、安装git和curl两个工具
sudo apt install git curl
2、设置你的git账号和邮箱
git config --global user.email "email address"
git config --global user.name "your name"
3、安装repo工具
mkdir ~/bin
export PATH=~/bin:$PATH  #添加path环境变量到.bashrc文件末尾
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
sudo chmod a+x ~/bin/repo
4、创建源码下载路径
mkdir android
cd android
5、初始化仓库
repo init -u https://android.googlesource.com/platform/manifest -b ${TARGER_BRANCH}   
6、下载代码

可直接使用repo sync进行同步,但是为了防止下载过程中中断,所以可以用下面的脚本来进行同步

    #!/bin/bash  
    echo "======start repo sync======"  
    repo sync  # 第一次下载android源代码
    while [ $? != 0 ]; do
        echo "======sync failed, re-sync again======"  
        sleep 2
        repo sync  #  如果出错,隔2秒后回继续调用repo sync下载android源代码
        done

二、安卓源码初始化包下载方法

[清华镜像站aosp源码下载说明](https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/)
[Aosp官方源码下载说明](https://source.android.com/setup/build/downloading)

三、repo命令使用说明

1、查看当前分支:repo branches
2、所有项目切换到指定分支,新建分支:repo start ${TARGET_BRANCH} –all

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值