歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 13.04下載 編譯Android 4.0

Ubuntu 13.04下載 編譯Android 4.0

日期:2017/2/28 14:35:31   编辑:Linux教程

首先參考 http://www.linuxidc.com/Linux/2014-03/97760.htm

Ubuntu 13.04下載Android 4.0.1源碼過程 http://www.linuxidc.com/Linux/2013-07/87028.htm

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

此前使用XP下硬盤安裝的Ubuntu 在下載Android 4.0源碼的過程中Ubuntu崩潰,登陸循環 無法解決 故從U盤安裝純Ubuntu。

U盤啟動安裝Ubuntu 13.04 http://www.linuxidc.com/Linux/2013-04/83525.htm

硬盤安裝Ubuntu參考 http://www.linuxidc.com/Linux/2013-10/91565.htm

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

下載源碼:

首先安裝git

sudo apt-get install git-core

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

mkdir bin

cd bin

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

如果出現

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/" />

OK 找個好時間 開始

repo sync

付上一個我正在下載的圖

共勉

編譯請看這裡Ubuntu 13.04編譯Android 4.0

Copyright © Linux教程網 All Rights Reserved