赞
踩
版本选择: https://source.android.google.cn/setup/start/build-numbers?hl=zh-cn#source-code-tags-and-builds
当前最新的为Android11, 不选11,怕有坑,怕自己第一个跳
详细安装过程,略过
国内请使用清华大学镜像,参考: https://mirror.tuna.tsinghua.edu.cn/help/AOSP/
下面简述过程:
- mkdir ~/bin
- PATH=~/bin:$PATH
后续讲repo 下载到该目录下,为了方便可以将其拷贝到你的PATH
里。
进入bin目录下载repo
- curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
- chmod +x repo
repo的运行过程中会尝试访问官方的git源更新自己,如果想使用tuna的镜像源进行更新,可以将如下内容复制到你的~/.bashrc
里
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
注: 配置repo时出现/usr/bin/env: ‘python’: No such file or directory, 因为ubuntu /usr/bin下默认安装的是python3, 所以找不到python, 执行 sudo apt-get install python 将安装python2
参考文档:
有两种方式:
由于首次同步需要下载约 30GB 数据,过程中任何网络故障都可能造成同步失败,所以首先使用初始化包进行初始化。 跳过
不走寻常路, 抱着试一下的态度,先试一下这种方式
初始化仓库:
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest
如果提示无法连接到 gerrit.googlesource.com,请参照git-repo的帮助页面的更新一节。
如果需要某个特定的 Android 版本(列表):
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-10.0.0_r41
同步源码树(以后只需执行这条命令来同步):
repo sync
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。