Precompiling APK files during Android AOSP build


By precompiling APK files during AOSP build a few minutes can be shaved off of the development iteration time on most commonly found Android hardware.

Enable precompilation

cd /opt/aosp_checkout/

find . -name

# Edit the that you are using for your build
cd device/linaro/generic/

# Add the config option

# Propagate the new settings
make defconfig
make all

Increase system partition size

Depending on the previous system partition size and how many APKs that are built, you may need to increase the system partition size.

nano configs/defconfig

# Change the below variable to something big enough to house all of you binaries

# Propagate the new settings
make defconfig
make all


This post has been a part of work undertaken by my employer Collabora.

Tags: aosp · apk · dex2oat · android · collabora