Ubuntu 20.04编译Android 8.1
一、配置环境
sudo apt install git-core gnupg flex bison gperf build-essential \ zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \ lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev \ libncurses5 libxml2-utils python xsltproc unzip
二、配置环境变量.bash_profile
# Compiler cache export USE_CCACHE=1 export PATH="/opt/local/bin:/opt/local/sbin:$PATH" export PATH=~/Documents/android/bin:$PATH export ANDROID_JAVA_HOME=$(/usr/libexec/java_home -v 1.8) export PATH=$ANDROID_JAVA_HOME/bin:$PATH export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
四、下载AOSP源代码
• 下载repo并设置权限
mkdir ~/Documents/android/bin curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/Documents/android/bin/repo chmod a+x ~/Documents/android/bin/repo
• 初始化仓库
cd ~/Documents/android_8.1 repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-8.1.0_r62 repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-8.1.0_r62 repo sync -c
五、编译AOSP源代码
cd ~/Documents/android_8.1 # Set ccache prebuilts/misc/linux-x86/ccache/ccache -M 50G # Clean out directory make clobber # Jack server configuration export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx6g" ./prebuilts/sdk/tools/jack-admin kill-server ./prebuilts/sdk/tools/jack-admin start-server # Setup environment source build/envsetup.sh # Select device target lunch # Build sources (cofee time) make -j8
六、编译单项
source build/envsetup.sh cd external/tinyxml mm
我最擅长从零开始创造世界,所以从来不怕失败,它最多也就让我一无所有。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决
2007-08-14 <魔兽争霸>微操教学
2007-08-14 C/C++ 笔试、面试题目大汇总 [转]
2007-08-14 计算几何常用算法概览
2007-08-14 Win32开发中最易踏上的地雷