第01说 Android 系统-下载asop源码
2018-11-30 本文已影响2人
牧馬放飏
背景
过程
1.创建bin文件夹
mkdir ~/bin
PATH=~/bin:$PATH
2.下载repo工具
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
3.repo初始化清单文件
wukaijiedeAir:aosp wukaijie$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
warning: gpg (GnuPG) is not available.
warning: Installing it is strongly encouraged.
4.安装gpg(如果已经安装的不需要这一步)
brew install gpg
注意:将 https://android.googlesource.com/ 全部使用 https://aosp.tuna.tsinghua.edu.cn/ 代替即可。
5.继续下载
wukaijiedeAir:aosp wukaijie$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 60] Operation timed out
6.本机使用shadowsocks,然后给终端设置代理
image.png
# 编辑bashrc
vim .bashrc
# 添加下面内容
export http_proxy="http://127.0.0.1:1087"
export https_proxy="http://127.0.0.1:1087"
# 刷新bashrc
source .bashrc
7.继续执行步骤5
$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
remote: Counting objects: 1, done
remote: Finding sources: 100% (11/11)
remote: Total 11 (delta 2), reused 11 (delta 2)
Unpacking objects: 100% (11/11), done.
From https://gerrit.googlesource.com/git-repo
d4b13c2..12ee544 master -> origin/master
* [new tag] v1.13.1 -> v1.13.1
Get https://aosp.tuna.tsinghua.edu.cn/platform/manifest
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (22) The requested URL returned error: 404
Server does not provide clone.bundle; ignoring.
remote: Counting objects: 12656, done.
remote: Compressing objects: 100% (8905/8905), done.
remote: Total 12656 (delta 4479), reused 3633 (delta 1119)
Receiving objects: 100% (12656/12656), 4.23 MiB | 432.00 KiB/s, done.
Resolving deltas: 100% (4479/4479), done.
From https://aosp.tuna.tsinghua.edu.cn/platform/manifest
* [new branch] adt_23.0.3 -> origin/adt_23.0.3
.........................
省略
.........................
Your identity is: Jonyker <jonyker@163.com>
If you want to change this, please re-run 'repo init' with --config-name
Testing colorized output (for 'repo diff', 'repo status'):
black red green yellow blue magenta cyan white
bold dim ul reverse
Enable color display in this user account (y/N)? y
repo has been initialized in /Users/wukaijie/bin
8.查看bin目录下面的文件
wukaijiedeAir:bin wukaijie$ ls -al
total 72
drwxr-xr-x 5 wukaijie staff 160 1 6 04:00 .
drwxr-xr-x+ 44 wukaijie staff 1408 1 6 04:07 ..
-rw-r--r--@ 1 wukaijie staff 6148 1 6 02:47 .DS_Store
drwxr-xr-x 6 wukaijie staff 192 1 6 04:00 .repo
-rwxr-xr-x@ 1 wukaijie staff 27759 1 6 02:48 repo
wukaijiedeAir:bin wukaijie$ cd .repo/
wukaijiedeAir:.repo wukaijie$ ls
manifest.xml manifests manifests.git repo
image.png