本人只需要部分源码做分析就研究,所以只下载了一部分,全部的没有下载过
不多废话直接上步骤:
1. 安装git
https://www.runoob.com/git/git-tutorial.html
2. 安装python
https://www.runoob.com/python/python-tutorial.html
3. 下载repo
-
找个合适的路径,如E:\program\repo\tsinghua
-
目录下,右击Git bash;话说在前面,这样可能不靠谱,请用管理员运行,然后手动切换到目录下,是最保险的!
-
git clone https://mirrors.tuna.tsinghua.edu.cn/git/git-repo
4. 修改REPO_URL
-
在E:\program\repo\tsinghua下使用编辑工具如Notepad++打开repo文件
-
找到:REPO_URL = 'https://gerrit.googlesource.com/git-repo'
-
改成:REPO_URL = 'git://aosp.tuna.tsinghua.edu.cn/android/git-repo'
5. 初始化
-
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-10.0.0_r17
6. 切大版本
-
有可能你要的大版本,不是我给的初始化版本
-
没关系
-
// 进manifests目录 cd .repo/manifests // 查看所有版本,列出一部分,可以翻页和中途退出 git branch -a // 查看所有版本,一下子列出所有的版本 git branch -a | cut -d / -f 3
-
找到自己的喜欢的版本
-
// 回到原来的地方 cd ../.. // 再此初始化 repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-10.0.0_r17
7. 选择自己喜欢的内容
-
打开E:\program\repo\tsinghua\.repo\manifest.xml
-
保险起见,保存一份backup,然后修改内容如下
-
我这里只要Camera2,你可以加自己喜欢的
-
<?xml version="1.0" encoding="UTF-8"?> <manifest> <remote name="aosp" fetch=".." review="https://android-review.googlesource.com/" /> <default revision="refs/tags/android-10.0.0_r17" remote="aosp" sync-j="4" /> <project path="packages/apps/Camera2" name="platform/packages/apps/Camera2" groups="pdk-fs" /> </manifest>
8. 同步代码
-
repo sync