文章標題

Android開發環境搭建

  1. 下載repo工具
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
## 如果上述 URL 不可訪問,可以用下面的:
## curl https://storage-googleapis.proxy.ustclug.org/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
  1. 然後建立一個工作目錄(名字任意)
mkdir WORKING_DIRECTORY
cd WORKING_DIRECTORY
  1. 初始化代碼倉庫
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest
## 如果提示無法連接到 gerrit.googlesource.com,可以編輯 ~/bin/repo,把 REPO_URL 一行替換成下面的:
## REPO_URL = 'https://gerrit-googlesource.proxy.ustclug.org/git-repo'
  1. 選擇特定版本初始化
這裏寫代碼片
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-4.0.1_r1
//android-2.3.1_r1
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-2.3.1_r1
  1.  同步源代碼
repo sync

install git

這裏寫代碼片
sudo apt-get install git

參考文章:
知呼:如何在中國下載Android源碼:
https://www.zhihu.com/question/20738613
AOSP科大
https://lug.ustc.edu.cn/wiki/mirrors/help/aosp

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章