android源码下载

操作平台: ubuntu20.04

下载android系统源码:

1、参考清华软件源:https://mirrors.cnnic.cn/help/AOSP/

google repo:

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

或者
tsinghua repo:

curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod +x repo

# repo的运行过程中会尝试访问官方的git源更新自己,如果想使用tuna的镜像源进行更新,可以将如下内容复制到你的~/.bashrc里
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

2、两种下载方式:

(1)、下载月更新包。(体积比较大,包含多个版本)
wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 下载初始化包
tar xf aosp-latest.tar
cd AOSP   # 解压得到的 AOSP 工程目录
# 这时 ls 的话什么也看不到,因为只有一个隐藏的 .repo 目录
repo sync # 正常同步一遍即可得到完整目录
# 或 repo sync -l 仅checkout代码
(2)、下载某个特定版本的源码。
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-11.0.0_r21
repo sync
# repo sync -j4

编译源码:

1、编译环境搭建

https://source.android.google.cn/docs/setup/build
# openjdk
apt install openjdk-11-jdk

# git-core 
# gnupg 
# flex 
# bison 
# build-essential 
# zip 
# curl 
# zlib1g-dev 
# gcc-multilib 
# g++-multilib 
# libc6-dev-i386 
# libncurses5 
# lib32ncurses5-dev 
# x11proto-core-dev 
# libx11-dev 
# lib32z1-dev 
# libgl1-mesa-dev 
# libxml2-utils 
# xsltproc 
# unzip 
# fontconfig

sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

2、开始编译。

source build/envsetup.sh

lunch  aosp_arm-eng

m -j4
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值