1. 创建bin路径
macbookpro-2d30:~ xxx$ mkdir bin
PATH=~/bin:$PATH
2. 从清华镜像下载repo文件
macbookpro-2d30:bin xxx$ git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git
从git-repo文件下载repo文件拷贝到bin目录
macbookpro-2d30:bin xxx$ cp git-repo/repo ~/bin/
macbookpro-2d30:bin xxx$ chmod a+x repo
3. 打开repo文件,修改REPO_URL为:
macbookpro-2d30:bin xxx$ vim repo
REPO_URL = 'git://aosp.tuna.tsinghua.edu.cn/android/git-repo'
4. 进入自定义的android源码路径:
repo init -u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest,即可。
5. repo sync -c -j4
清华镜像使用帮助:https://mirrors.tuna.tsinghua.edu.cn/help/#AOSP
中科大镜像使用帮助:https://lug.ustc.edu.cn/wiki/mirrors/help/aosp
Android官方使用帮助:http://source.android.com/source/requirements.html(要翻墙)
使用清华镜像搭建Android开发环境
本文介绍如何通过清华镜像下载并配置Android开发所需的repo工具,包括创建bin路径、下载repo文件并进行配置,以及初始化Android源码路径。
1万+

被折叠的 条评论
为什么被折叠?



