android 源代码下载

  1. 安装repe

    按照google官方的设置repo的下载路径和环境变量

     $ mkdir ~/bin
     $ PATH=~/bin:$PATH
    

    google 版本:

     $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    

    很多时候这个不能工作了,需要下面这个

     $ curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo
    

    下载好之后需要

     $ chmod a+x ~/bin/repo
    
  2. 下载源代码

    • 设置下载路径

        $ mkdir WORKING_DIRECTORY
        $ cd WORKING_DIRECTORY
      
    • 按照google官方的地址

        $ repo init -u https://android.googlesource.com/platform/manifest
      

      这个也存在不能工作的问题,就用这个清华版本的

        $repo init -u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest
      

      初始化好之后就该下载代码了

        $ repo sync
      

      这个时候可能会提示一个错误说

        fatal: '../platform/abi/cpp.git' does not appear to be a git repository
        fatal: Could not read from remote repository.
      

      需要修改.repo文件夹下的manifest.xml

        <remote  name="aosp"
           fetch=".."
           review="https://android-review.googlesource.com/" />
      

      改成

        <remote  name="aosp"
           fetch="git://aosp.tuna.tsinghua.edu.cn/android/"
           review="https://android-review.googlesource.com/" />
      

    也就是fetch字段的值

剩下的就是漫长等待了

转载于:https://my.oschina.net/u/2293714/blog/361371

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值