android 源代碼下載

  1. 安裝repephp

    按照google官方的設置repo的下載路徑和環境變量android

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

    google 版本:git

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

    不少時候這個不能工做了,須要下面這個web

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

    下載好以後須要api

    $ chmod a+x ~/bin/repo
  2. 下載源代碼app

    • 設置下載路徑curl

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

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

      這個也存在不能工做的問題,就用這個清華版本的google

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

      初始化好以後就該下載代碼了url

      $ 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字段的值

剩下的就是漫長等待了

相關文章
相關標籤/搜索