下载AOSP 代码

由于国内无法直接从googlesource里下载代码,国内一些大学给大家提供了镜像服务

清华镜像: https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
科大镜像: https://lug.ustc.edu.cn/wiki/mirrors/help/aosp/

环境准备

  • Linux,如:Ubuntu,Deepin
  • 下载 repo 脚本
  • 安装 git 软件

下载git软件

sudo apt-get install git

下载repo脚本

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

如果无法从googleapis.com网站下载可以从镜像网站下载,如下:

mkdir ~/bin
PATH=~/bin:$PATH
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod a+x ~/bin/repo

除此之外还需要将镜像源地址写入到~/.bashrc里,以便repo更新自己,同时将repo写入到PATH里,以便在任何目录下都可以使用该命令。

export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
export PATH=~/bin:$PATH

下载代码

初始化仓库

# android-12.0.0_r15
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest  -b android-12.0.0_r15

# 最新的代码
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest  

同步代码

# checkout所有文件
repo sync -c -j18

# checkout 指定仓库的文件
repo sync -c -j18 <仓库名称>

收藏:下面是常用的仓库:

hardware/interfaces
hardware/ril

frameworks/base
frameworks/opt/telephony
frameworks/opt/net/ims

packages/apps/Settings
packages/apps/CarrierConfig
packages/apps/SecureElement
packages/services/Telecomm
packages/services/Telephony
packages/services/Mms
packages/providers/TelephonyProvider

system/netd
system/libhidl
system/libhwbinder
system/hwservicemanager

– 完毕 –

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值