Building AOSP

Last update: 2022-04-06 23:20:26 +0800 +0800
Available translations: 日本語 / 中文(简体) / 中文(繁體)

An Android Open Source Project checkout and its build artifacts require substantial disk space; the exact requirement depends on the branch, target, and enabled variants. Use a 64-bit Linux host with ample RAM, fast storage, and enough free space for both the checkout and the output directory.

Obtaining the Source #

AOSP is distributed across many Git repositories. The repo tool coordinates those repositories from a manifest; it is a Python wrapper around Git rather than a source control system of its own. Initialize the required branch with repo init, then use repo sync to populate or update the checkout.

Android’s build system is Soong. Module definitions are generally Android.bp Blueprint files; Soong uses Ninja for execution, and Kati supports the remaining Android Make compatibility layer. Select a product and build variant with the AOSP environment setup scripts before invoking the documented build target for that branch.

Running an Image #

Use the emulator or QEMU only with an image and machine configuration supported by the target. Android products are hardware-specific: boot firmware, kernel, partitions, and device configuration must agree. For generic x86_64 development, the Android Emulator is usually the supported choice; QEMU is useful when experimenting with a compatible kernel, firmware, and disk layout.

Comments

Read or comment on GitHub (sign-in required to comment)