Android源码编译原生模拟器

源代码下载

安装repo

确保主目录下有一个 bin/ 目录,并且该目录包含在路径中:

mkdir ~/bin
PATH=~/bin:$PATH

下载 Repo 工具,并确保它可执行:

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

查看分支

repo init -u https://android.googlesource.com/platform/manifest

查看android支持分支版本 链接

初始化

使用 -b 来指定相应分支。

repo init -u https://android.googlesource.com/platform/manifest -b android-12.1.0_r26

下载

repo sync

代码编译

命令

source build/envsetup.sh
lunch $buildType
make -j4

$buildType的选择

终端输入lunch可以看到支持的build选项

1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_blueline_car-userdebug
4. aosp_bonito_car-userdebug
5. aosp_bramble_car-userdebug
6. aosp_car_arm-userdebug
7. aosp_car_arm64-userdebug
8. aosp_car_x86-userdebug
9. aosp_car_x86_64-userdebug
10. aosp_cf_arm64_auto-userdebug
11. aosp_cf_arm64_phone-userdebug
12. aosp_cf_x86_64_foldable-userdebug
13. aosp_cf_x86_64_pc-userdebug
14. aosp_cf_x86_64_phone-userdebug
15. aosp_cf_x86_64_tv-userdebug
16. aosp_cf_x86_auto-userdebug
17. aosp_cf_x86_phone-userdebug
18. aosp_cf_x86_tv-userdebug
19. aosp_coral_car-userdebug
20. aosp_crosshatch_car-userdebug
21. aosp_flame_car-userdebug
22. aosp_redfin_car-userdebug
23. aosp_sargo_car-userdebug
24. aosp_sunfish_car-userdebug
25. aosp_trout_arm64-userdebug
26. aosp_trout_x86-userdebuaosp_car_x86_64-userdebugg
27. aosp_x86-eng
28. aosp_x86_64-eng
29. arm_krait-eng
30. arm_v7_v8-eng
31. armv8-eng
32. armv8_cortex_a55-eng
33. armv8_kryo385-eng
34. beagle_x15-userdebug
35. beagle_x15_auto-userdebug
36. car_x86_64-userdebug
37. db845c-userdebug
38. gsi_car_arm64-userdebug
39. gsi_car_x86_64-userdebug
40. hikey-userdebug
41. hikey64_only-userdebug
42. hikey960-userdebug
43. hikey960_tv-userdebug
44. hikey_tv-userdebug
45. pixel3_mainline-userdebug
46. poplar-eng
47. poplar-user
48. poplar-userdebug
49. qemu_trusty_arm64-userdebug
50. sdk_car_arm-userdebug
51. sdk_car_arm64-userdebug
52. sdk_car_x86-userdebug
53. sdk_car_x86_64-userdebug
54. silvermont-eng
55. uml-userdebug
56. yukawa-userdebug
57. yukawa_sei510-userdebug

其中以aosp_car_arm-userdebug来说明,aosp_car表示平台,arm表示平台架构,userdebug表示编译类型。

编译

make命令可以编译系统,还可以单独编译某个模块,比如

make systemimage 编译system分区镜像

make vendorimage 编译vendor分区镜像

make SystemUI 编译SystemUI

make Gallery 编译图册

make framework 编译framework框架

编译问题

参考 Android源码编译问题

运行模拟器

命令

emulator

错误

cannot add library /home/jun/data/AOSP12/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library /home/jun/data/AOSP12/prebuilts/android-emulator/linux-x86_64/lib64/vulkan/libvulkan.so
INTEL-MESA: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0configAndStartRenderer: setting vsync to 60 hz
qemu-system-x86_64: Could not open '/home/jun/data/AOSP12/out/target/product/generic_car_x86_64/userdata-qemu.img': No such file or directory

找不到userdata-qemu.img 我们需要将编译选项切换到sdk...比如sdk_car_x86_64-userdebug

重新执行 emulator

ref

下载源代码

特定设备上运行编译系统信息

代号、标记和细分版本号

Android源码编译原生模拟器相关推荐

  1. [Android Pro] Android源码编译之Nexus5真机编译

    reference to : http://blog.csdn.net/liu1075538266/article/details/51272398 1.   前言 在Android安全的研究工作中, ...

  2. Android源码编译之Nexus5真机编译

    1.   前言 在Android安全的研究工作中,我们时常要对Android进行改进并对其进行源码编译,由于目前几乎所有的手机厂商均对其底层驱动实行封闭政策,导致我们在完成Android编译后无法将我 ...

  3. Android源码编译及启动模拟器

    Android源码编译及启动模拟器 源码下载 (1)更改下载源 (2)安装源码下载工具 (3)下载源码 (4)安装环境依赖 源码编译 启动模拟器 源码下载 Ubuntu18.0 (1)更改下载源 源码 ...

  4. Android 源码编译详解【合集篇】

    Android 源码编译详解[一]:服务器硬件配置及机型推荐 做 Android系统开发多年,开发环境都是入职就搭建好了,入职时拿个账号密码就直接开始搞开发了,年初换了新公司,所有的项目都是刚起步,一 ...

  5. Android源码编译(基于Ubuntu18.0.4)

    文章目录 一.环境搭建 硬件要求 软件要求 操作系统和 JDK 主要软件包 软件安装 Git安装 repo工具安装 安装 openJDK 8 其他依赖安装 二.源码下载 建立源码文件夹 初始化仓库 源 ...

  6. Android源码编译make的各类错误解决方案汇总

    问题: You are attempting to build with the incorrect version of java.  Your version is: java version & ...

  7. Android 源码编译及常见错误及解决方法

    Android 源码编译及常见错误及解决方法 参考文章: (1)Android 源码编译及常见错误及解决方法 (2)https://www.cnblogs.com/kyyblabla/p/360393 ...

  8. 【Android开发】构建Android源码编译环境

    原文:http://android.eoe.cn/topic/android_sdk 构建Android源码编译环境 123456789 10 11 12 13 14 15 16 17 18 $ su ...

  9. android源码编译出错的原因

    (1)gcc的版本过高,由于android源码编译要求为4.3,如果你的gcc版本为4.4,那你的编译可能会失败的!我的系统是ubuntu 10.04,默认的gcc版本为4.4,gcc-4.4太严格, ...

最新文章

  1. Unreal Engine 4 —— 异步加载关卡的实现方法及思考
  2. linux下的c socket编程(4)--server端的继续研究
  3. 蓝桥杯-8-1因式分解(java)
  4. 新疆兵团谋定丰收美景-万祥军:对话农民丰收节交易会
  5. ai画面怎么调大小_ai如何调整对象大小
  6. matlab中的libsvm怎么录入数据啊,LibSVM在MATLAB中使用时的几个问题
  7. 算法--库函数实现全排列
  8. 2016-6-16 拓展练习
  9. idea 热部署时 tomcat处 没有update classes and resource 选项
  10. css + div + js 制作HTML tab control
  11. enum枚举类型 的用法
  12. 数据库执行update语句,一直执行不完【已解决】
  13. PLC编程系统的使用经验分享
  14. 一款完整的多用户微信公众平台开发源码,带文档免费分享
  15. 车牌号对应归属地及城市JSON带简码
  16. 基于华为鲲鹏云的c语言程序设计,华为DevRun第四讲,华为云鲲鹏云服务移植快速入门与实践...
  17. 十进制转换成二进制 (栈)
  18. 【ShardingSphere技术专题】「ShardingJDBC实战阶段」SpringBoot之整合ShardingJDBC实现分库分表(JavaConfig方式)
  19. 【2018.10.4】CXM笔记(图论)
  20. 送书 | 用啥selenium!JS逆向不香吗?

热门文章

  1. 电子基础系列-放大器的那些点滴
  2. GAN属于计算机视觉领域嘛_看见AI:人工智能在计算机视觉领域的历史与未来
  3. 蓝奏云批量下载 with urllib3 — Python39
  4. 研究生 课程 软件测试
  5. 永磁同步电机三相等效电路图_三相永磁同步电动机的控制电路的制作方法
  6. python计算汽车的平均油耗_聊聊汽车油耗怎么计算
  7. 免费上传文件的站点:http://www.esnips.com
  8. 利用虚拟机复现漏洞 “永恒之蓝”
  9. 遭遇勒索病毒数据库被删除之后
  10. 虎背熊腰力拔撑-筋骨训练: