This page contains notes of building Android Open Source Project (AOSP) images on Macbook.
As easy as changing repo branch and syncing
# On aosp that has been initialized earlier to another branch (like master):
repo init -b android-11.0.0_r32
repo sync -c -j8
Doc: Setting a file descriptor limit
The recommended limit of 1024 open files is not enough with 8 cores. Use 2048.
ulimit -S -n 2048
Doc: Creating the case-sensitive disk image
AOSP instructs to create sparse case-sensitive HFS+ image. But, when you remove lots of files from the image (rm -rf environment
or make clobber
), HFS is not so goot re-using the free’d image space. Unmount and compact the image (at the end of the day):
umountAndroid
hdiutil compact android.dmg.sparseimage
mountAndroid
Doc: Separate output directory
If you have external SSD disk at hand, such as Samsung T7, use that as build output space. This way, I/O will be split between two drives - internal SSD will be doing the reads, external SSD will store the results.
export OUT_DIR_COMMON_BASE=/Volumes/SamsungT7
m droid
Remember to initialize the disk to case-sensitive format (HDF+ or AFS). Disk Utility helps on that. The external disk does not need to be sparse.
kernel_task
is eating the CPUDoc: TLDR; Charge from right side port
On Macbook Pro 16” 2019, under load, driving an external display reduces CPU average frequency about 400MHz (results may vary). That’s 12.5% increase - the same as one core in 8-core machine.
On Dell display plugged via USB-C, it’s enough to turn the display off from power button. Try Intel Power Gadget to see the difference.