日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

ubuntu环境下载android源码

發布時間:2024/8/1 Ubuntu 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu环境下载android源码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、 Ubuntu環境

使用lsb_release -a查看ubuntu版本信息

二、編譯使用的工具下載

安裝git

1、下載git

sudo apt-get install git

2、配置git

git config --global user.email "你的電子郵件地址" git config --global user.name "你的名字"

安裝repo

1、下載curl

sudo apt-get install curl

2、新建一個bin目錄

mkdir ~/bin

3、將bin目錄寫入環境變量

PATH=~/bin:$PATH

4、使用curl工具下載repo,并將其放置到bin目錄

curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo > ~/bin/repo

5、設置中科大鏡像源

export REPO_URL='https://mirrors.ustc.edu.cn/aosp/git-repo.git/'

6、更改repo權限

chmod a+x ~/bin/repo

7、在想創建的位置新建目錄,用來下載android源碼

/home/ubuntu/terry/android/android_source/android-7.0

8、進入到剛剛創建的文件夾,初始化倉庫

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest

9、如果你只想下載特定的android版本,可以使用如下命令:

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.0_r4

執行上述命令的時候,可能會出現以下錯誤提示:

這是由于國內無法訪問google的資源,此時我們需要使用國內的鏡像資源。
1、修改~/.bashrc,添加以下內容
export REPO_URL=‘https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/’

vim ~/.bashrc

2、執行source ~/.bashrc,使修改生效

source ~/.bashrc

重新執行:repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.0_r4

9、最后執行sync命令

repo sync

10、下載完成(166G)

總結

以上是生活随笔為你收集整理的ubuntu环境下载android源码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。