Android AOSP资源的下载
Android Studio 导入系统源码并对源码进行debug调试

安装 jdk8

sudo apt-get update
sudo apt-get install openjdk-8-jdk

安装以下依赖包

sudo apt-get 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 ccache libgl1-mesa-dev libxml2-utils xsltproc unzip

初始化环境

进入aosp目录执行

source build/envsetup.sh
// 编译前删除build文件夹A
make clobber

选择编译目标

lunch

会出现如下内容

You're building on LinuxLunch menu... pick a combo:1. aosp_arm-eng2. aosp_arm64-eng3. aosp_mips-eng4. aosp_mips64-eng5. aosp_x86-eng6. aosp_x86_64-eng7. aosp_car_arm-userdebug8. aosp_car_arm64-userdebug9. aosp_car_x86-userdebug10. aosp_car_x86_64-userdebug11. mini_emulator_arm64-userdebug12. m_e_arm-userdebug13. m_e_mips64-eng14. m_e_mips-userdebug15. mini_emulator_x86_64-userdebug16. mini_emulator_x86-userdebug17. uml-userdebug18. aosp_cf_x86_auto-userdebug19. aosp_cf_x86_phone-userdebug20. aosp_cf_x86_tablet-userdebug21. aosp_cf_x86_tablet_3g-userdebug22. aosp_cf_x86_tv-userdebug23. aosp_cf_x86_wear-userdebug24. aosp_cf_x86_64_auto-userdebug25. aosp_cf_x86_64_phone-userdebug26. aosp_cf_x86_64_tablet-userdebug27. aosp_cf_x86_64_tablet_3g-userdebug28. aosp_cf_x86_64_tv-userdebug29. aosp_cf_x86_64_wear-userdebug30. cf_x86_auto-userdebug31. cf_x86_phone-userdebug32. cf_x86_tablet-userdebug33. cf_x86_tablet_3g-userdebug34. cf_x86_tv-userdebug35. cf_x86_wear-userdebug36. cf_x86_64_auto-userdebug37. cf_x86_64_phone-userdebug38. cf_x86_64_tablet-userdebug39. cf_x86_64_tablet_3g-userdebug40. cf_x86_64_tv-userdebug41. cf_x86_64_wear-userdebug42. aosp_marlin-userdebug43. aosp_marlin_svelte-userdebug44. aosp_sailfish-userdebug45. aosp_walleye-userdebug46. aosp_walleye_test-userdebug47. aosp_taimen-userdebug48. hikey-userdebug49. hikey64_only-userdebug50. hikey960-userdebugWhich would you like? [aosp_arm-eng]
  • user:用来正式发布到市场的版本,权限受限,如没有 root 权限,不能 dedug,adb默认处于停用
  • userdebug:在user版本的基础上开放了 root 权限和 debug 权限,adb默认处于启用状态。一般用于调试真机。
  • eng:开发工程师的版本,拥有最大的权限(root等),具有额外调试工具的开发配置。一般用于模拟器。

指定编译的目标:

lunch aosp_x86-eng

开始编译

make -j6

编译的过程中遇到这个问题:

prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

解决方法:

sudo apt-get install libncurses*

终于编译成功了!!!

如果想重新编译Android项目,如果想做清理工作,可以执行如下操作:

1、在源码目录的根目录下,执行 make clean;

2、进到源码的\linux\kernel\目录下,执行make mrproper;

3、再退回到根目录,执行source build/envsetup.sh, lunch, make -j6.

编译的得到的内容
out/target/product/generic_x86/ 这个目录下会生成三个重要的文件
system.img->Android系统镜像,系统的主要目录和文件
usedata.img->用户镜像,用来存放用户的数据
ramdisk.img->根文件系统镜像

启动虚拟机

source build/envsetup.sh
lunch 6
export PATH=$PATH:~/andrfoid9/out/host/linux-x86/bin
export ANDROID_PRODUCT_OUT=~/android9/out/target/product/generic_x86
emulator

如果是刚编译完可以直接执行

export PATH=$PATH:~/andrfoid9/out/host/linux-x86/bin
export ANDROID_PRODUCT_OUT=~/android9/out/target/product/generic_x86
emulator

感谢

https://blog.csdn.net/itachi85/article/details/89038370?spm=1001.2014.3001.5501

ubuntu 20.04 编译Android9.0的android源码相关推荐

  1. 基于imx8m plus开发板全体系开发教程3:Ubuntu 20.04 编译

    前言: i.MX8M Plus 开发板是一款拥有 4 个 Cortex-A53 核心,运行频率 1.8GHz;1 个 Cortex-M7 核心,运行频率 800MHz;此外还集成了一个 2.3 TOP ...

  2. ubuntu 20.04编译Android源码

    一直以来想编译android源码,趁闲编译了下,ubuntu版本:20.04,android源码版本:android-9.0.0_r30.总体还比较顺畅,中间遇到了一些报错,在文中也有记录,详情见下文 ...

  3. 16.04编译android 7.0,[原创]使用ubuntu 16.04编译android-6.0.0_r1

    前言 最近一直在折腾这个android源码从Mac到docker再到ubuntu14.04,最后换了ubuntu 16.04,前前后后花了大概2个星期,感觉自己就是自带bug的男人...呵呵了,记录一 ...

  4. Ubuntu 20.04编译AOSP 并启动模拟器

    平台 CPU: Intel® Core™ i7-8700 CPU @ 3.20GHz DDR: 24GB 硬盘: SSD 1TB 系统: Ubuntu 20.04 x64 概述 疫情期间居家办公, 为 ...

  5. Ubuntu 20.04编译WebRTC

    环境:虚拟机64位Ubuntu 20.04 前提:需要有一个可以用的代理(非常重要,没有代理几乎无法下载完整的WebRTC代码) 一.环境配置 WebRTC中文网有提供国内的WebRTC镜像,但目前W ...

  6. Ubuntu 20.04 编译报错 `No package ‘orocos-bfl‘ found` 的解决方法

    写在前面 Ubuntu 20.04.5 ROS-noetic 一.问题描述 编译ros程序是出现如下报错: No package 'orocos-bfl' found 二.解决方法 按照之前的Ubun ...

  7. ubuntu 20.04安装fail2ban1.0.1

    安装: 由于ubuntu 20.04已经默认没有python2,所以不使用python2来安装fail2ban,改使用python3来安装. 通过github下载fail2ban源码 wget htt ...

  8. 高通android编译命令,高通Android源码

    电脑环境: Ubuntu17.04 高通开源源码网站:下载地址 安装git &repo sudo apt install git sudo apt install repo 修改repo su ...

  9. 简诉android源代码编译过程,详解Android源码的编译

    在这里我们将介绍的是Android源码的编译,主要基于Android 1.0环境下.希望对大家有所帮助. 本文将为大家介绍的是如何设置Android源码的编译环境,包括Linux下的配置.主要基于An ...

最新文章

  1. FPGA与ASIC:它们之间的区别以及使用哪一种?
  2. 大主子表关联的性能优化方法
  3. 【缩点】解题报告:luogu P2746 [USACO5.3]校园网Network of Schools(有向图、强连通分量、缩点)
  4. AdamW优化算法 笔记
  5. [OS复习]程序装入技术、简单存储管理技术
  6. 离职交接文档_关于工作交接
  7. 计算机基础教育学,计算机基础教育教学改革与创新
  8. 485不用双绞线可以吗_现在在上海,挡风玻璃可以一个标志都不用贴吗?
  9. 【原创】Kakfa utils源代码分析(一)
  10. 264编码基本概念 FFMpeg的解码流程
  11. thinkphp图片加载_标题栏ico展示
  12. 国土空间适宜性评价与承载力评价之间的逻辑关系是什么?
  13. JavaScript多浏览器兼容
  14. 华为杨超斌:5G千元机有望明年底上市
  15. post发送请求参数注意的问题
  16. 获取客户端的IP地址
  17. Gulp快速入门教程 1
  18. python消费kafka_Python脚本消费kafka数据
  19. office 打开wps乱_word打开wps是乱码怎么办
  20. dell屏幕亮度调节不了_戴尔笔记本无法调节亮度怎么办?如何找回调节亮度?

热门文章

  1. JavaScript-关闭窗口(window.close)
  2. 轰动世界的10大营销理念
  3. js时间分割——主要用途——租赁合同时间计算(两种时间分割方式,可以按月,季,年分割)
  4. python3 利用ffmpeg把音频转换为16khz的wav文件
  5. linux strip作用,linux gcc strip命令简介
  6. 30天自制操作系统——第五天
  7. 【linux】web服务器
  8. 实现对 2:3 或者3:2的图片进行1:1裁剪
  9. 6个大厂Offer,牛逼!
  10. 向量余弦值(Cosine)(C#)