We're hiring!
*

Quick hack: Precompiling APK files during Android AOSP build

Robert Foss avatar

Robert Foss
February 23, 2017

Share this post:

Reading time:

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 BoardConfig.mk
./device/huawei/angler/BoardConfig.mk
./device/generic/mini-emulator-x86/BoardConfig.mk
./device/generic/arm64/BoardConfig.mk
./device/generic/mini-emulator-x86_64/BoardConfig.mk
./device/generic/mini-emulator-armv7-a-neon/BoardConfig.mk
./device/generic/mips/BoardConfig.mk
./device/generic/mips64/BoardConfig.mk
./device/generic/x86_64/BoardConfig.mk
./device/generic/mini-emulator-arm64/BoardConfig.mk
./device/generic/mini-emulator-mips/BoardConfig.mk
./device/generic/x86/BoardConfig.mk
./device/generic/armv7-a-neon/BoardConfig.mk
./device/generic/mini-emulator-mips64/BoardConfig.mk
./device/lge/bullhead/BoardConfig.mk
./device/linaro/generic/linaro_x86_64_only/BoardConfig.mk
./device/linaro/generic/linaro_arm64/BoardConfig.mk
./device/linaro/generic/linaro_arm64_only/BoardConfig.mk
./device/linaro/generic/linaro_x86_64/BoardConfig.mk
./device/linaro/generic/BoardConfig.mk
./device/linaro/generic/linaro_arm/BoardConfig.mk
./device/linaro/hikey/hikey/BoardConfig.mk

# Edit the BoardConfig.mk that you are using for your build
cd device/linaro/generic/
nano BoardConfig.mk

# Add the config option
WITH_DEXPREOPT := true

# 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
CONFIG_BOARD_SYSTEMIMAGE_PARTITION_SIZE=1100000000

# Propagate the new settings
make defconfig
make all

 

Thanks!

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

Original post

Comments (0)


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

Automatic regression handling and reporting for the Linux Kernel

14/03/2024

In continuation with our series about Kernel Integration we'll go into more detail about how regression detection, processing, and tracking…

Almost a fully open-source boot chain for Rockchip's RK3588!

21/02/2024

Now included in our Debian images & available via our GitLab, you can build a complete, working BL31 (Boot Loader stage 3.1), and replace…

What's the latest with WirePlumber?

19/02/2024

Back in 2022, after a series of issues were found in its design, I made the call to rework some of WirePlumber's fundamentals in order to…

DRM-CI: A GitLab-CI pipeline for Linux kernel testing

08/02/2024

Continuing our Kernel Integration series, we're excited to introduce DRM-CI, a groundbreaking solution that enables developers to test their…

Persian Rug, Part 4 - The limitations of proxies

23/01/2024

This is the fourth and final part in a series on persian-rug, a Rust crate for interconnected objects. We've touched on the two big limitations:…

How to share code between Vulkan and Gallium

16/01/2024

One of the key high-level challenges of building Mesa drivers these days is figuring out how to best share code between a Vulkan driver…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2024. All rights reserved. Privacy Notice. Sitemap.