ubuntu13.04下載 編譯android 4.0 (一)

 首先感謝http://blog.csdn.net/speedingboy/article/details/5455037

我遇到的困難有一些就在這裏解決了。大家可以參看

感謝這些無私奉獻的人們


此前使用XP下硬盤安裝的ubuntu 在下載android4.0源碼的過程中ubuntu奔潰,登陸循環 無法解決 故從U盤安裝純Ubuntu

u盤安裝ubuntu參考 http://www.ubuntu.com/download/zh-CN


ubuntu 就自己安裝 不建議使用虛擬機。建議單一系統安裝。

下載源碼:

首先安裝git

sudo apt-get install git-core 

然後在HOME 目錄下創個文件夾BIN 用來存放 repo

mkdir bin

cd bin

sudo apt-get install curl

curl http://git-repo.googlecode.com/files/repo-1.12> ~/bin/repo

對repo添加權限

chmod a+x repo


添加環境

PATH=$PATH:~/bin


創建一個文件夾存放源碼

mkdir ~/workAndroid

cd ~/workAndroid


後面這個步驟比較重要

  • 用瀏覽器登錄https://android.googlesource.com/new-password,並用gmail帳號登錄;  
  • 點擊網頁上的“允許訪問”,得到類似的結果:  
  •    
  • machine android.googlesource.com login git-<userName>.gmail.com password <password>  
  • machine android-review.googlesource.com login git-<userName>.gmail.com password <password>  
  •  將上邊的兩行追加到~/.netrc文件結尾。(如果你的linux系統中從來沒有建立過此文件,就在home目錄下建立.netrc文件,將上面的信息加到新建的文件中去),  
  • 下載地址的URI更改爲https://android.googlesource.com/a/platform/manifest。  
  •    
  • 因爲訪問基本是匿名的,爲了防止連接過多,對同一IP地址的連接數做了一定的限制。用gmail帳號進行認證。  
  • 在公司網絡內或者用虛擬機下載的話,會經常遇到這問題。 

repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1

PS:切忌 切勿使用

sudo repo init -u https://android.googlesource.com/a/platform/manifest -b android-4.0.3_r1

如果出現
fatal: unable to auto-detect email address
那麼就在終端輸入你的郵箱
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
就像這樣

現在你的初始化已經成功了。在 repo sync之前 我建議做這一步

打開.repo/manifest.xml。找到下面一段:

<remote  name="aosp"
           fetch=".." />
修改成
<remote  name="aosp"
        fetch="git://Android.git.linaro.org/"/>


相信我 做了這個步驟下載起來飛快 再也不會亂報錯了

如果提示這個地址沒有鏈接 可以嘗試使用這個:

<remote  name="aosp"
           fetch="https://android.googlesource.com/" />


備用地址 git://Android.git.kernel.org/


OK 找個好時間 開始

repo sync

付上一個我正在下載的圖


共勉


編譯請看這裏ubuntu 13.04編譯android 4.0

發佈了22 篇原創文章 · 獲贊 1 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章