-
安装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
-
下载源代码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字段的值
-
剩下的就是漫长等待了