ubuntu环境下载android源码
生活随笔
收集整理的這篇文章主要介紹了
ubuntu环境下载android源码
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
一、 Ubuntu環(huán)境
使用lsb_release -a查看ubuntu版本信息
二、編譯使用的工具下載
安裝git
1、下載git
sudo apt-get install git2、配置git
git config --global user.email "你的電子郵件地址" git config --global user.name "你的名字"安裝repo
1、下載curl
sudo apt-get install curl2、新建一個(gè)bin目錄
mkdir ~/bin3、將bin目錄寫入環(huán)境變量
PATH=~/bin:$PATH4、使用curl工具下載repo,并將其放置到bin目錄
curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo > ~/bin/repo5、設(shè)置中科大鏡像源
export REPO_URL='https://mirrors.ustc.edu.cn/aosp/git-repo.git/'6、更改repo權(quán)限
chmod a+x ~/bin/repo7、在想創(chuàng)建的位置新建目錄,用來下載android源碼
/home/ubuntu/terry/android/android_source/android-7.08、進(jìn)入到剛剛創(chuàng)建的文件夾,初始化倉庫
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest9、如果你只想下載特定的android版本,可以使用如下命令:
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.0_r4執(zhí)行上述命令的時(shí)候,可能會出現(xiàn)以下錯(cuò)誤提示:
這是由于國內(nèi)無法訪問google的資源,此時(shí)我們需要使用國內(nèi)的鏡像資源。
1、修改~/.bashrc,添加以下內(nèi)容
export REPO_URL=‘https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/’
2、執(zhí)行source ~/.bashrc,使修改生效
source ~/.bashrc重新執(zhí)行:repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.0_r4
9、最后執(zhí)行sync命令
repo sync10、下載完成(166G)
總結(jié)
以上是生活随笔為你收集整理的ubuntu环境下载android源码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【网络安全】单选/多选/判断/填空题
- 下一篇: Ubuntu下安装JRE7