Android深入--02--下载源码

0x0001 官方教程

https://source.android.com/source/initializing.html

NOTE:
Installing the JDK
The master branch of Android in the Android Open Source Project (AOSP) requires Java 8. On Ubuntu, use OpenJDK.
看着是OpenJDK, 擦,老汉用的sun 的。

tom@tommain:~$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
tom@tommain:~$

不管了,先试试吧,碰到问题再说。

0x0002另外的设置

The suggested cache size is 50-100G.

我靠,
需要这么多,老汉磁盘貌似不够,暂停吧,改天换笔记本搞。

0x0003 format了一个盘。。。。

0x0004 下载code,配置先不管了,等编译的时候再说阿

tom@tommain:~$ cd /media/tom/rom/
tom@tommain:/media/tom/rom$ ls
lost+found
tom@tommain:/media/tom/rom$ mkdir bin
tom@tommain:/media/tom/rom$ vim ~/.bashrc 
tom@tommain:/media/tom/rom$ . ~/.bashrc 
tom@tommain:/media/tom/rom$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > bin/repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 27759  100 27759    0     0  28412      0 --:--:-- --:--:-- --:--:-- 28412
tom@tommain:/media/tom/rom$ ls bin/
repo
tom@tommain:/media/tom/rom$ chmod 777 bin/repo 
tom@tommain:/media/tom/rom$ ll
total 28
drwx------  4 tom  tom   4096 Feb 27 22:36 ./
drwxrwxrwx+ 5 root root  4096 Feb 27 22:32 ../
drwxrwxr-x  2 tom  tom   4096 Feb 27 22:37 bin/
drwx------  2 root root 16384 Feb 27 22:22 lost+found/
tom@tommain:/media/tom/rom$ rep
replace  repo     
tom@tommain:/media/tom/rom$ repo init -u https://android.googlesource.com/platform/manifest
gpg: keyring `/home/tom/.repoconfig/gnupg/secring.gpg' created
gpg: keyring `/home/tom/.repoconfig/gnupg/pubring.gpg' created
gpg: /home/tom/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 920F5C65: public key "Repo Maintainer <repo@android.kernel.org>" imported
gpg: key 692B382C: public key "Conley Owens <cco3@android.com>" imported
gpg: Total number processed: 2
gpg:               imported: 2  (RSA: 1)

Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
Get https://android.googlesource.com/platform/manifest
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  .......
   * [new tag]         studio-1.4 -> studio-1.4
 * [new tag]         studio-1.5 -> studio-1.5
 * [new tag]         studio-2.0 -> studio-2.0
 * [new tag]         studio-2.0-rc1 -> studio-2.0-rc1
 * [new tag]         studio-2.2 -> studio-2.2
 * [new tag]         studio-2.2-preview3 -> studio-2.2-preview3
 * [new tag]         studio-2.2.2 -> studio-2.2.2
 * [new tag]         studio_0.8.6 -> studio_0.8.6
 * [new tag]         studio_1.0.0 -> studio_1.0.0
 * [new tag]         studio_1.0.1 -> studio_1.0.1
 * [new tag]         ub-jack-arzon-mr2 -> ub-jack-arzon-mr2
 * [new tag]         webview-m40_r1 -> webview-m40_r1
 * [new tag]         webview-m40_r2 -> webview-m40_r2
 * [new tag]         webview-m40_r3 -> webview-m40_r3
 * [new tag]         webview-m40_r4 -> webview-m40_r4

Your identity is: tom <qdtom@foxmail.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 /media/tom/rom

0x0005 指定特定的版本下载

tom@tommain:/media/tom/rom$ repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r9
.repo/manifests/: discarding 302 commits

Your identity is: tom <qdtom@foxmail.com>
If you want to change this, please re-run 'repo init' with --config-name

repo has been initialized in /media/tom/rom

0x0006去掉repo的用户名提示 阿

tom@tommain:/media/tom/rom$ repo init --config-name 'tom'

Your Name  [tom]: tom
Your Email [qdtom@foxmail.com]:      

Your identity is: tom <qdtom@foxmail.com>
is this correct [y/N]? y

repo has been initialized in /media/tom/rom

0x0007同步代码

repo sync

然后就是漫长的等待。。。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值