编译环境: ubuntu18.04
建议找个网盘 下载android-11.0.0_r37.tar.gz 也可以找 wx:EagleAndy 【100G 留足空间】
- source build/envsetup.sh 用envsetup.sh(它在源代码根目录/build下面)脚本初始化环境
- make clobber 在编译新版本之前请清理之前编译过的文件
- lunch #不带参数运行,会显示各个版本和对应序号
- lunch aosp_x86_64-eng
- make -j8
- sudo chmod -R 777 /dev/kvm
-
emulator
过程中遇到的问题
- 执行emulator遇到
The KVM line in /etc/group is: [kvm:x:999:shixingya]
If the current user has KVM permissions,
the KVM line in /etc/group should end with ":" followed by your username.
If we see LINE_NOT_FOUND, the kvm group may need to be created along with permissions:
sudo groupadd -r kvm
# Then ensure /lib/udev/rules.d/50-udev-default.rules contains something like:
# KERNEL=="kvm", GROUP="kvm", MODE="0660"
# and then run:
sudo gpasswd -a $USER kvm
If we see kvm:... but no username at the end, running the following command may allow KVM access:
sudo gpasswd -a $USER kvm
You may need to log out and back in for changes to take effect.
ERROR: x86_64 emulation currently requires hardware acceleration!
CPU acceleration status: This user doesn't have permissions to use KVM (/dev/kvm).
解决方案:
执行 sudo chmod -R 777 /dev/kvm