欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

AOSP源碼下載及問題小結(jié)

 更新時間:2022年03月16日 16:47:06   作者:Amosstan  
這篇文章主要介紹了AOSP源碼下載,包括源碼下載示例,文中給大家介紹了配置下載方法,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

一、說明

由于一些原因,利用谷歌的資源下載Android源碼速度很慢,我們可以用清華源里面的資源進(jìn)行下載。
清華源AOSP配置下載地址詳解:Android 鏡像使用幫助

二、源碼下載示例

由于清華源中給出很清晰的配置下載方法,這兒只做幾條總結(jié):

1. 谷歌鏡象不可用,采用清華源鏡象

https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/

2. 配置repo

mkdir ~/bin
PATH=~/bin:$PATH
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
chmod a+x ~/bin/repo

注意:repo最好加到系統(tǒng)的環(huán)境變量中。

3. repo更新

repo的運(yùn)行過程中會嘗試訪問官方的git源更新自己,如果想使用tuna的鏡像源進(jìn)行更新,可以將如下內(nèi)容復(fù)制到你的~/.bashrc里

export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

并重啟終端模擬器。

4. 下載初始化包

wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar

5. 解壓資源包

tar xf aosp-latest.tar

6. 更新指定版本

比如指定下載android-6.0.1_r62,執(zhí)行以下命令:

repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-6.0.1_r62
repo sync

如果遇到"SyntaxError: invalid syntax"等錯誤,如下所示:

File "/home/jerry/workspace/aosp/.repo/repo/main.py", line 79
    file=sys.stderr)
        ^
SyntaxError: invalid syntax

應(yīng)該是python語法導(dǎo)致的,解決方法如下:

python3 ~/bin/repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-6.0.1_r62
python3 ~/bin/repo sync

7. 快捷腳本

由于網(wǎng)絡(luò)及限制網(wǎng)絡(luò)并發(fā)等原因,repo sync常常更新失敗,可以用腳本來更新,腳本示例:

repo sync -j4
	while [ $? = 1 ]; do
	        echo "==== sync failed, re-sync again ===="
	        sleep 3
	        repo sync -j4
	done

三、注意

1. 遇到同步失敗的問題

比如OMA-DM這個app同步失敗,我們可以修改AOSP目錄下的.repo/manifests/default.xml來屏蔽掉這個應(yīng)用的同步,如下圖:

在這里插入圖片描述

2. 遇到python語法問題

參照如下語法根據(jù)實(shí)際情況執(zhí)行repo命令,注意repo要寫上絕對路徑,否則會報(bào)錯。

python3 ~/bin/repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-6.0.1_r62
python3 ~/bin/repo sync

到此這篇關(guān)于AOSP源碼下載的文章就介紹到這了,更多相關(guān)AOSP源碼下載內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論