下载AOSP源码

AOSP的代码太大了,下载了源代码的tar包后,解压后,里面都是隐藏文件夹,如果不需要把aosp的最新的代码下载的本地,只是要把解压后的代码拿出来看看的话,只需要执行:

$ repo sync -l

如果要下载最新的aosp代码,则要执行:

$ repo sync

如果硬盘空间够大,下载最新的版本。

由于所有代码都是从隐藏的 .repo 目录中 checkout 出来的,下载后解压 再 repo sync 一遍即可得到完整的目录。

使用方法如下:

wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 下载初始化包
tar xf aosp-latest.tar
cd AOSP   # 解压得到的 AOSP 工程目录
# 这时 ls 的话什么也看不到,因为只有一个隐藏的 .repo 目录
repo sync -l # 仅checkout代码

如果硬盘空间不够,可以找以前的版本,网址:https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly

我在执行repo sync -l,报错误:

AttributeError: 'str' object has no attribute 'decode'

在网上查到了解决办法:https://blog.csdn.net/qq_41185868/article/details/82079079

直接去掉代码decode('utf8')

c/c++ 学习互助QQ群:877684253

本人微信:xiaoshitou5854

原文地址:https://www.cnblogs.com/xiaoshiwang/p/13266655.html