首先就是各種軟件的下載。
第一步下載git
sudo apt-get upgrade
sudo apt-get install git
git config --global user.email "xxxxxxx@gmail.com"
git config --global user.name "xxxxx"
第二步下載Python
1、sudo apt update
2、sudo apt install python3.9
//查看python版本號,確認是否安裝成功
3、python3-V
下載aosp因為安裝python出現(xiàn)的小插曲,Ubuntu給出的報錯
/usr/bin/env: ‘python’: No such file or directory
解決方案
whereis python3 //查看python3的安裝位置因為我們已經(jīng)在上面下載安裝了
sudo ln -s /usr/bin/python3 /usr/bin/python //為python創(chuàng)建符號連接
第三步下載openssl
sudo apt-get install openssl
sudo apt-get install libssl-dev
第四步下載curl
sudo apt-get install curl
第五步下載repo
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
## 如果上述 URL 不可訪問,可以用下面的:
## curl -sSL 'https://gerrit-googlesource.proxy.ustclug.org/git-repo/+/master/repo?format=TEXT' |base64 -d > ~/bin/repo
chmod a+x ~/bin/repo
接下來就是激動人心的cv時刻,我使用的是中科大的鏡像,按照中科大給的方案
創(chuàng)建工作目錄
mkdir WORKING_DIRECTORY
cd WORKING_DIRECTORY
初始化倉庫:
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'
如果需要某個特定的 Android 版本(Android 版本列表 (CN),鏡像站 tags 列表):
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-4.0.1_r1
同步源碼樹(以后只需執(zhí)行這條命令來同步):
repo sync
下載好后是這個樣子的

image.png