Ubuntu13.04下载Android源代码

来源:互联网 发布:北大网络教学 编辑:程序博客网 时间:2024/05/22 09:48

1 : 创建android-source目录: mkdir android-src

2: 创建~/bin目录:mkdir ~/bin

3:安装curl (自行百度)、安装git:

sudo apt-get install git
sudo apt-get install git-core

4:下载repo :

官方(有错误):curl http://android.git.kernel.org/repo>~/bin/repo 

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

5:修改repo属性使其可以运行:chmod 777 repo

6:跳转到android-source目录下:cd android-src

7:初始化android源代码分支:~/bin/repo init -u https://android.googlesource.com/platform/manifest

输入用户名和邮箱确认

8:修改fetch属性以加速下载:

sudo gedit .repo/manifest.xml将fetch项修改为:fetch= "https://android.googlesource.com/"

9:同步:~/bin/repo sync

10:自动下载android脚本:

1>建立文件为autosync:

#!/bin/bash   
echo "======start repo sync======"   
repo sync   
while [ $? = 1 ]; do   
echo “======sync failed, re-sync again======”   
sleep 3   
repo sync   
done   

$? 表示前一命令的运行状态的返回值,0表示正常,其他值表示错误.

2>修改属性 : chmod 777 autosync

3> ./autosync


0 0
原创粉丝点击