標籤:下載 google name 環境 man font nbsp aosp repo
1.下載Ubuntu系統,推薦16.04以上版本;
2. git : 使用repo工具的時候會用到git,要預先安裝git,使用命令:sudo apt-get install git
3. 安裝git後,對git進行配置,設定git電子郵件和使用者名稱
(1) git config --global user.email "你的電子郵件"
(2) git config --global user.name "你的名字"
4. 安裝curl (開源檔案傳輸工具) , 使用命令: sudo apt-get install curl -y
5. 重要環節 : 下載repo
下載repo之後,將repo的路徑設為環境變數,並且將許可權改成可執行
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
6. 接下來建立一個目錄,用於放置Android源碼,並進入該目錄如下:
(1) mkdir android
(2) cd android
7. 使用repo初始化
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest
如果提示無法串連到 gerrit.googlesource.com,可以編輯 ~/bin/repo,把 REPO_URL 一行替換成:
REPO_URL = ‘https://mirrors.tuna.tsinghua.edu.cn/git/git-repo‘
如果你只想下載特定的android版本,可以使用如下命令:
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b Android版本 (比如:android-7.1.1_r13)
8. 下載代碼,命令如下 (註:這個過程很耗時間)
repo sync
簡記Ubuntu下載 Android源碼