Ubuntu 1604 下载android source code

来源:互联网 发布:里约中国男篮数据 编辑:程序博客网 时间:2024/04/28 22:05

官方下载指导文档。

环境

  • Ubuntu 1604 64bit 台式机上的双硬盘双系统
  • Lantern pro 用来穿越长城
  • java version “1.8.0_91”
  • 南方电信
  • 100G磁盘空间

步骤

  • 安装Repo

       ```  $ mkdir ~/bin   $ PATH=~/bin:$PATH  $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo  $ chmod a+x ~/bin/repo   ```

    上面主要功能是:

  • 新建存放Repo的文件夹bin

  • 把该文件夹加入环境变量
  • 下载Repo文件
  • 修改repo文件为最高权限,chmod 777的作用

    2.初始化Repo

    $ mkdir WORKING_DIRECTORY    $ cd WORKING_DIRECTORY    $ git config --global user.name "Your Name"    $ git config --global user.email "you@example.com"    $ repo init -u https://android.googlesource.com/platform/manifest    $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1 
  • 新建存放源码的文件夹
  • 进入该文件夹
  • 配置GIT 用户名随便写
  • 配置GIT,邮箱要能连接到Google 账户的,恩,直说gmail得啦
  • 配置GIT主要是验证提交代码时用到,估计大伙儿都用不到forever!
  • repo初始化,并且拉去官网源码版本列表
  • repo下载对应的源码

3.下载

repo sync

问题

  • 代理问题
  $ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>  $ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

如果使用到是lantern那么,就

    export HTTP_proxy=http://localhost:8787    export HTTPS_proxy=http://localhost:8787      
  • IP问题
    如果和别人共享IP,那么需要去这里,验证你的Google帐号,把得到到命令copy到shell里。
    然后,继续
$ repo init -u https://android.googlesource.com/a/platform/manifest

注意,和上面有所不同,多了/a,应该是表示Using Authentication吧。

0 0