Ubuntu 20.0.4 编译Android最新源码

一、下载源码

1.1 下载 repo 工具

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

1.2 下载源码

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

image.png

官网查看源码

二、搭建Linux编译环境

2.1 安装依赖库

   sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
   sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
   sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
   sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev
   sudo apt-get install git-core gnupg flex bison gperf build-essential
   sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
   sudo apt-get install libc6-dev-i386
   sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
   sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
   sudo apt-get install lib32z-dev ccache
   sudo apt-get install libssl-dev       

三、源码编译

3.1 使用 envsetup.sh 脚本初始化环境:

source build/envsetup.sh

build/envsetup.sh

3.2 选择目标

source build/envsetup.sh 
lunch 1
time make -j12

你可能感兴趣的:(Ubuntu 20.0.4 编译Android最新源码)