清华镜像源下载Android源码
2016-09-20 22:46
281 查看
felix@ubuntu:~$ mkdir ~/bin
felix@ubuntu:~$ PATH=~/bin:$PATH
felix@ubuntu:~$ git clone https://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/[/code]felix@ubuntu:~$ cp git-repo/repo ~/bin/
编辑 ~/bin/repo,把 REPO_URL 一行替换成下面的:REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'
建立一个名为android_source的工作目录:felix@ubuntu:~$ mkdir android_sourcefelix@ubuntu:~$ cd android_source/
设置git邮箱和用户名:felix@ubuntu:~$ git config --global user.email "这里填你的邮箱" felix@ubuntu:~$ git config --global user.name "这里填你的用户名"
如果没有设置git用户邮箱和用户名,运行下面初始化仓库的命令是会出现下面的错误提示:Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this reposi ae4e tory. fatal: unable to auto-detect email address (got 'felix@ubuntu.(none)')
初始化仓库(此处使用android-5.1.1_r25,看你需要什么源码版本):felix@ubuntu:~/android_source$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.1_r62
出现下面画面表示前面的步骤成功(也有可能步骤没错,但还是出了问题,下面说到):Get https://gerrit-google.tuna.tsinghua.edu.cn/git-repo/clone.bundle Get https://gerrit-google.tuna.tsinghua.edu.cn/git-repo remote: Counting objects: 1, done remote: Finding sources: 100% (80/80) remote: Total 80 (delta 30), reused 80 (delta 30) Unpacking objects: 100% (80/80), done. From https://gerrit-google.tuna.tsinghua.edu.cn/git-repo 58f85f9..6284568 master -> origin/master 203153e..39252ba stable -> origin/stable * [new tag] v1.12.34 -> v1.12.34 Get https://aosp.tuna.tsinghua.edu.cn/platform/manifest ...... * [new tag] android-5.1.1_r20 -> android-5.1.1_r20 * [new tag] android-5.1.1_r22 -> android-5.1.1_r22 * [new tag] android-5.1.1_r23 -> android-5.1.1_r23 * [new tag] android-5.1.1_r24 -> android-5.1.1_r24 * [new tag] android-5.1.1_r25 -> android-5.1.1_r25 * [new tag] android-5.1.1_r26 -> android-5.1.1_r26 ......
如果出现下面的提示,导致初始化失败:fatal: Cannot get https://gerrit-google.tuna.tsinghua.edu.cn/git-repo/clone.bundle fatal: error [Errno 101] Network is unreachable
这大概是网络的原因,把上面那条初始化命令再跑几次试一下,就成功了。就我的经验而言,有时候没有出现上面的网络问题,有时候把repo init初始化命令再跑一遍就行,还试过跑几次才成功的
同步源码树:felix@ubuntu:~/android_source$ repo sync
同步源码树过程中可能会不断出现下面提示:curl: (22) The requested URL returned error: 404 Not Found
不必理会,只要同步过程没有停止就是没有问题的。
如果同步的过程中断了,例如不小心把命令行窗口关闭了,再次执行repo sync命令即可。如果在代码同步完成前重启了机器,就需要先把repo添加到环境变量,再执行repo sync命令。felix@ubuntu:~$ PATH=~/bin:$PATH felix@ubuntu:~/android_source$ repo sync
漫长的等待之后(看网速,我用了半天),同步完成会出现:...... Syncing work tree: 100% (486/486), done.
相关文章推荐
- Android源码下载 清华AOSP镜像源
- 清华TUNA镜像源下载Android源码的方法
- Android源码的下载,清华asop镜像
- 使用清华镜像下载Android源码
- 清华镜像下载Android源码
- 清华TUNA镜像源下载Android源码的方法
- Windows环境下载android源码~~
- Android源码下载
- 在windows下下载android源码(转载)
- android源码的下载和编译,需要安装的库
- Git在Red Hat Enterprise Linux Server release 5.1上的安装(android源码下载必备工具)
- Ubuntu 9.10下的Android源码下载及编译
- Android源码下载,利用一个shell脚本
- Android源码下载
- Windows环境下下载Android源码(Launcher为例) [转]
- android 源码下载编译全过程必读
- 下载android源码
- ubuntu 9.04上下载android源码
- Ubuntu 9.04中下载编译Android源码
- Android Launcher研究(一)-----------图文详解手把手教你在Windows环境下下载Android源码(Launcher为例)