@系統要求:
1、Ubuntu 10.04或以上版本
2、64位系統(查看系統命令: uname -m 如果出現i386 i686 i586則是32位 如果出現amd64 則是64位系統 )
3、jdk1.6 或更高版本
@說明:下面如果有修改文件不好保存或無法打開可能是權限問題要進入那個目錄修改權限 chmod 777 filename
1安裝下載源碼所需要的工具
1.1
sudo apt-get install git-core curl
這條命令會從互聯網的軟件倉庫中安裝 git-core 和 curl
1.2
mkdir ~/bin
PATH=~/bin:$PATH
在home目錄下建立bin目錄並設置環境變量
1.3
curl http://Android.git.kernel.org/repo >~/bin/repo
這句命令會下載 repo 腳本文件到當前主目錄的/bin 目錄下,並保存在文件repo 中。
1.4
chmod a+x ~/bin/repo
修改 repo 文件可執行權限
1.5
執行下面的命令創建並進入空文件夾
mkdir yourdirectory
cd yourdirectory
2repo客戶端初始化
2.1
下面是官網給的命令,但在公司行不通會報Connection timed out的錯誤,但在家直接用估計可以
repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
2.2
在公司同步要先將bin裡的.repo文件的
REPO_URL='git://android.git.kernel.org/tools/repo.git'
改成
REPO_URL='http://android.git.kernel.org/tools/repo.git'
然後命令改成下面這個(注意後面的版本號寫法和官網不太一樣,如果寫-b Gingerbread的話會找不到版本)
repo init -u http://android.git.kernel.org/platform/manifest.git -b android-2.3.3_r1
(參考http://www.linuxidc.com/Linux/2011-08/41222.htm)
2.3
執行上面的命令可能還會報個IOError找不到文件(暫時還不知道為什麼)
但執行下面兩條命令
touch ~/.gitconfig
rm -rf .repo
後再執行2.2的命令就可以同步了
成功的話會叫你填寫自己的名字和郵箱