ubuntu环境下载android源码
生活随笔
收集整理的這篇文章主要介紹了
ubuntu环境下载android源码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、 Ubuntu環境
使用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、新建一個bin目錄
mkdir ~/bin3、將bin目錄寫入環境變量
PATH=~/bin:$PATH4、使用curl工具下載repo,并將其放置到bin目錄
curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo > ~/bin/repo5、設置中科大鏡像源
export REPO_URL='https://mirrors.ustc.edu.cn/aosp/git-repo.git/'6、更改repo權限
chmod a+x ~/bin/repo7、在想創建的位置新建目錄,用來下載android源碼
/home/ubuntu/terry/android/android_source/android-7.08、進入到剛剛創建的文件夾,初始化倉庫
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執行上述命令的時候,可能會出現以下錯誤提示:
這是由于國內無法訪問google的資源,此時我們需要使用國內的鏡像資源。
1、修改~/.bashrc,添加以下內容
export REPO_URL=‘https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/’
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 sync10、下載完成(166G)
總結
以上是生活随笔為你收集整理的ubuntu环境下载android源码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【网络安全】单选/多选/判断/填空题
- 下一篇: Ubuntu下安装JRE7