Before you download and build the Android source, ensure that your system meets the following requirements, then see Establishing a Build Environment for installation instructions by operating system.
Hardware requirements
Your development workstation should meet or exceed these hardware requirements:
- A 64-bit environment is required for Android 2.3.x (Gingerbread) and higher versions, including the main branch. You can compile older versions on 32-bit systems.
- At least 250GB of free disk space to check out the code and an extra 150 GB to build it. If you conduct multiple builds, you need additional space.
- Google recommends at least 64 GB of RAM and doesn't test with less. Lower amounts lead to builds being OOM killed.
As of June 2021, Google is using 72-core machines with 64 GB of RAM internally, which take about 40 minutes for a full build (and just a few minutes for incremental builds, depending on exactly which files were modified). By contrast, a 6-core machine with a similar amount of RAM takes 3 hours.
Software requirements
The AOSP
main
branch is traditionally
developed and tested on Ubuntu Long Term Support (LTS) releases, but other
distributions may be used. See
Establishing a Build Environment for
additional required packages and the commands to install them.
Your workstation must have the software listed below.
These requirements apply to the AOSP main
branch. For Android
versions 8.0 (Oreo or O) through 5.0 (Lollipop or L), consider using the included
Dockerfile
to ease installation of all required packages. For the manual method, see
Supporting Older Versions.
OS
If you're developing against the AOSP main
branch, use
Ubuntu 18.04 or later.
JDK
The main
branch of Android in AOSP comes with a prebuilt version
of OpenJDK, so no additional installation is required.
Older versions of Android require a separate installation of the JDK. On Ubuntu, use OpenJDK.
Key packages
The AOSP main branch comes with a prebuilt version of Make, so no additional installation is required. Git is similarly installed as part of the Establishing a Build Environment process.
Ensure that your system has Python 3.
Device binaries
Download previews, factory images, drivers, over-the-air (OTA) updates, and other blobs below. For details, see Obtaining proprietary binaries.
- Preview
binaries (blobs) for AOSP
main
branch development - Factory images for supported devices running tagged AOSP release branches
- Binary hardware support files for devices running tagged AOSP release branches
Build toolchain
Android 8.0 and higher only supports building with clang/LLVM, including for host tools.
Older releases used GCC instead. In both cases, Android only supports building with the
prebuilt compiler checked in under prebuilts/
.