- 安装repo
安装git:sudo apt-get install git-core
安装curl:sudo apt-get install git-core curl
通过curl下载repo:
mkdir ~/bin
curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
//如果上面的链接不行, 换成下面中科大代理
https://storage-googleapis.proxy.ustclug.org/git-repo-downloads/repo > ~/bin/repo
下载android源码
创建一个工作目录
mkdir android
cd android
初始化仓库:
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest
如果提示无法连接到 gerrit.googlesource.com,可以编辑 ~/bin/repo,把 REPO_URL 一行替换成下面的:
REPO_URL = ‘https://gerrit-googlesource.proxy.ustclug.org/git-repo’- 1.~/bin/repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-4.0.1_r1
2.~/bin/repo sync
- 1.~/bin/repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-4.0.1_r1
将~/bin添加环境变量这样直接运行repo即可
android2.3到4.4之间只能安装jdk1.6
已经安装jdk,却提示build/core/config.mk:268: * Error: could not find jdk tools.jar
把jdk路径移植到/usr/lib/jvm 如果没有jvm创建即可
运行下面四条命令:jdk1.6.0_67 换成你自己jdk的名字
sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_67/bin/java 300
sudo update-alternatives –install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_67/bin/javac 300
sudo update-alternatives –install /usr/bin/javah javah /usr/lib/jvm/jdk1.6.0_67/bin/javah 300
sudo update-alternatives –install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_67/bin/jar 300
安装vim
sudo apt-get install vim-gtk
git安装提示unable to auto-detect email address
git config --global user.email "我的邮箱"
git config --global user.name "姓名"