AOSP 安卓源码7.1编译-真机运行
编译环境配置
Ubuntu17.04 |
安装openjdk(7/8/9) |
sudo apt-get install openjdk-8-jdk |
安装git |
sudo apt-get install git git config --global user.name "accout" git config --global user.email "accout @qq.com" sudo apt-get install repo |
添加依赖 |
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 |
|
|
获取源码
Android7.1 |
repo工具准备 |
mkdir ~/bin PATH=~/bin:$PATH curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod a+x ~/bin/repo curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo chmod +x repo |
建立源码文件 |
mkdir source cd source repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest // 最近版本 repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.1.1_r16 // 指定版本 // 细分版本 NUF26K repo sync |
备注 |
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.1.1_r16 repo init -u git://aosp.tuna.tsinghua.edu.cn/aosp/platform/manifest -b android-7.1.1_r16 repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.1.1_r24 |
编译源码
编译 |
编译工程 |
source build/envsetup.sh lunch aosp_arm64-eng make -j8 |
编译模块 |
. build/envsetup.sh m:编译所有的模块 mm:编译当前目录下的模块,当前目录下要有Android.mk文件 mmm:编译指定路径下的模块,指定路径下要有Android.mk文件 !!!编译前需执行:. build/envsetup.sh,否则报错找不到命令xx ref:link |
|
|
参考:
获取源码
Codenames, Tags, and Build Numbers 主线版本
编译
打造自己的Android源码学习环境之五:编译Android源代码
烧录
从谷歌官网下载android 6.0源码、编译并刷入nexus 6p手机
Factory Images for Nexus and Pixel Devices