urlname
type
Post
password
SyncToConfluence
category
Android
date
Apr 4, 2024
slug
01HTY9T7863SPGSPT83MA7VDVD
icon
Button
catalog
summary
tags
AOSP
Android
cover
Status
BusyTime
Status 1
status
Published
😀
主要记录如何在Ubuntu22.04(虚拟机)下载并编译AOSP(Android 13)

📝 虚拟机准备

💡
Ubuntu系统安装之后,需要配置网络,使得虚拟机内可以访问网络,同时,要配置代理,使其能正常科学上网。 具体如何配置,有很多配置教程和不同操作,不赘述。

VMware Workstation Pro:

  • 密钥:NV6RH-2RH50-0JD79-0T9N2-A22M2

系统镜像

  • Linux发行版:Ubuntu 22.04

系统安装

  • 关于VMware如何安装Ubuntu的教程,网上有很多,不赘述
  • 这里提供两个参考:
How to Install Ubuntu 22.04 LTS on VMware Workstation Player On Windows 11
00:00:05 Download VMware Workstation Player 00:01:15 Download an Ubuntu Image 00:02:30 Install VMware Workstation Player 00:03:50 Create a new virtual machine 00:09:15 Install your Ubuntu image More Tutorials for VMWare Workstation: https://www.youtube.com/playlist?list=PLnisUReSm0-ms8q_fNgcRJKte3_HUoyqq Follow me on Facebook: https://fb.me/tanztalks.tech Join our Facebook Group and Post your Problems: https://www.facebook.com/groups/769372597093758 Please take a moment to like and comment on my video. It helps me stay motivated! :) ----------------------------------------------------------------------------------------------------------------- Tutorials on Oracle VirtualBox: https://www.youtube.com/playlist?list=PLnisUReSm0-nTIHjGwwzNIDdA7qVeLfe2 How to Install Ubuntu 22.04 LTS on Oracle VirtualBox in Windows 11 https://youtu.be/C5mJ2SwmN0w ----------------------------------------------------------------------------------------------------------------- If you are interested in learning about Web Design. Check out these playlist Restaurant Theme Responsive HTML/CSS Website: https://www.youtube.com/playlist?list=PLnisUReSm0-kdxFZ9A6IKfUH7Wu2qzj3J CSS Tips and Tricks | CSS Animations and Effects: https://www.youtube.com/playlist?list=PLnisUReSm0-nMk-6ujxyl4QBvm0Q0D3zi Portfolio Theme Responsive Bootstrap Website: https://www.youtube.com/playlist?list=PLnisUReSm0-nXCgnGW3D-A4irRWQKkY4F Business Theme Responsive Animated Bootstrap Website: https://www.youtube.com/playlist?list=PLnisUReSm0-kLEHlrDkw12syBQ7xjhtG2 Travel Theme Responsive HTML/CSS Website From Scratch: https://www.youtube.com/playlist?list=PLnisUReSm0-l4YlWMhCpgdskikQkd8dPv Website Creation Tutorials: https://www.youtube.com/playlist?list=PLnisUReSm0-nOe1CzyS3jEGk2-F9fl9A2 Host a website on your computer without any hosting server or buying domain: https://www.youtube.com/watch?v=VlRQ6l6FsY0 ----------------------------------------------------------------------------------------------------------------- If you are interested in learning about Android App Development. Check out these playlist Create Login and Register Android App with Firebase Authentication in Android Studio using Java https://www.youtube.com/playlist?list=PLnisUReSm0-kNhfXJHymlIFeyGYHj87tP Create State-District Dependent (Nested) Android Spinners using Java in Android Studio | DropDown List https://www.youtube.com/playlist?list=PLnisUReSm0-kDK_uYoUGGNUHrg3t-i8kY Android Basics https://www.youtube.com/playlist?list=PLnisUReSm0-mqSodOSJMwyw2blOm-6gEu Audience: Anyone with a basic knowledge of Computers Follow Me on Facebook: https://fb.me/tanzTalks.tech GitHub: https://github.com/tanzeelosama My Gear: MSI GL65 Leopard Gaming Laptop o Processor: Intel Core i7-10750H 2.6GHz, 10th Gen (6 Cores) o Display: 15.6" FHD (1920*1080), IPS-Level 144Hz o Memory: 16GB DDR4 RAM, 2666Mhz o Graphics: Nvidia GeForce RTX 2060, 6GB ‎GDDR6 o Storage: 256GB NVMe M.2 SSD + 1TB SATA 7200RPM HDD o Operating System: Windows 11 Home, 64Bit o Web Camera: HD Webcam (720p at 30 fps) o Keyboard: Per Key RGB SteelSeries Keypad #VMwareWorkstation #VMwarePlayer #Ubuntu #Ubuntu22 #Linux #tanzTalkstech #TanzeelOsama
How to Install Ubuntu 22.04 LTS on VMware Workstation Player On Windows 11

虚拟机配置

  • 由于AOSP项目较大,完整的代码大概需要300G,且编译时候,对内存也有一定要求,所以,尽量把虚拟机的配置给高些
  • 这是我的配置:
    • notion image

Swap内存设置

  • 这一步为可选步骤,主要是设置Swap内存的
  • 查看Swap内存的配置:sudo swapon --show
  • 禁用Swap文件:sudo swapoff /swapfile
  • 删除旧的Swap文件:sudo rm /swapfile
  • 重新设置Swap文件及大小:

SSH配置

  • 这一步可选,主要是用于从物理机ssh连进虚拟机,如果要发现连接时候连接不上,可能是需要开启端口映射以及安装ssh服务

🤗 下载前的准备

安装并配置Git

安装repo

下载AOSP源码

官方说明

创建源码文件夹

下载源码

  • 由于国内网络原因,直接从AOSP官方拉取源码,速度较慢,且需要科学上网,这里不从官网拉,而是从国内镜像源拉
  • 拉取地址:
    • 官方源:https://android.googlesource.com/platform/manifest
    • 中科大源:git://mirrors.ustc.edu.cn/aosp/platform/manifest
  • 初始化repo参考指令:
    • 下载源码:sudo repo sync
    • 静候佳音

    安装编译环境

    编译AOSP

    官方说明:

    加载shell环境变量

    选择编译版本

    • 方式一:
      • 先执行 lunch 命令,查看当前Android源码支持的所有设备代号和编译类型。
      • 选择要构建的目标,输入对应的数字进行构建
    • 方式二:
      • lunch product_name-build_variant
      • eg: lunch aosp_x86_64-eng

    开始编译

    😆 build目标说明

    • 格式组成:product_name-release-build_variant
    notion image

    📎 参考/推荐

    Java GC时的四种引用JUC中的各种锁
    Loading...