Set up for AOSP development (2.3 - 8.0)  |  Android Open Source Project Skip to main content Docs What's new? Release notes Latest security bulletins Latest Compatibility Definition Document (CDD) Site updates Getting Started About Start Download Builds Test Create Contribute Community Tools, build, and related reference Security Overview Bulletins Features Testing Best Practices Core Topics Architecture Audio Camera Connectivity Data Display Fonts Graphics Interaction Media Performance Permissions Power Runtime Settings Storage Tests Updates Virtualization Compatibility Compatibility Definition Document (CDD) Compatibility Test Suite (CTS) Android Devices Cuttlefish Enterprise TV Automotive Overview Software Defined Vehicle In-vehicle Infotainment Release Details Reference HIDL HAL Trade Federation Security Test Suite Android Code Search / English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어 Sign in Documentation What's New? Getting Started Security Core Topics Compatibility Android Devices Automotive Reference Docs More What's New? Getting Started Security Core Topics Compatibility Android Devices Automotive Reference Android Code Search Overview About AOSP overview FAQ Start Try Android development Understand terminology Set up for AOSP development (9.0 or later) Set up for AOSP development (2.3 - 8.0) Download Download the Android source Troubleshoot and fix sync issues Source control tools Build Build overview Build Android Use feature launch flags Feature launch flag overview Determine flag usage and type Declare an aconfig flag Wrap code change in feature launch flag Set feature launch flag values Change a flag's value at runtime Declare and use a build flag Test code within feature launch flags Build kernels Build Pixel kernels Convert from Make to Soong Implement Java SDK library Android Rust Introduction Android Rust modules Binary modules Library modules Test modules Fuzz modules Source generators Source generators overview Bindgen bindings modules Protobuf modules Hello Rust example Android Rust patterns Rust IDE setup Compile with Jack (6.0 - 8.1) Create Source control workflow Custom device development Add a new device type Build for 32-bit and 64-bit architectures Use reference boards Create a software bill of materials (SBOM) Configure and handle update ownership for apps Test Test a build Flash with Fastboot Flash with Android Flash Tool Test with the cuttlefish emulator Use Android Emulator virtual devices Contribute Overview Android Code Search Contributor license agreements and headers Release lifecycle Submit code changes Contribute to upstream projects Git source editor Review a change Download build artifacts Report and track bugs Code with respect AOSP Java code style for contributors API guidelines Overview Android async and nonblocking API guidelines Android API client-side caching guidelines Community Code of conduct Discussion groups, contacts, and additional resources Tools, build, and related reference Overview Android.bp file format Kernel branches and their build systems Codenames, tags, and build numbers Fastboot key combinations Repo command reference What's new? Release notes Latest security bulletins Latest Compatibility Definition Document (CDD) Site updates Getting Started About Start Download Builds Test Create Contribute Community Tools, build, and related reference Security Overview Bulletins Features Testing Best Practices Core Topics Architecture Audio Camera Connectivity Data Display Fonts Graphics Interaction Media Performance Permissions Power Runtime Settings Storage Tests Updates Virtualization Compatibility Compatibility Definition Document (CDD) Compatibility Test Suite (CTS) Android Devices Cuttlefish Enterprise TV Automotive Overview Software Defined Vehicle In-vehicle Infotainment Release Details Reference HIDL HAL Trade Federation Security Test Suite Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP. AOSP Docs Getting Started Set up for AOSP development (2.3 - 8.0) Stay organized with collections Save and categorize content based on your preferences. This page discusses how to set up for development with Android 8.0 or lower versions. To learn how to build Android 9.0 and higher, see Set up for AOSP development. Warning: The information on this page is provided as is and might not yield success when building Android.Note: As of June 22, 2021, building new versions of AOSP on Mac OS X isn't supported. However, you can set up and build Android 2.3 to Android 8.0 on Mac OS X. Set up for AOSP development (5.0 - 8.0) For Android 5.0 through 8.0, consider using the included Dockerfile to ease the installation of all required packages. Operating systems Android is typically built with a GNU Linux. It's also possible to build Android in a virtual machine on unsupported systems such as Mac OS X. Google recommends building on GNU Linux. The Android build system normally runs ART on the build machine to precompile system DEX files. ART can run only on Linux, so the build system skips this precompilation step on non-Linux operating systems, resulting in an Android build with reduced performance. GNU Linux Android 6.0 - Android 8.0: Ubuntu 14.04 (Trusty) Android 5.x: Ubuntu 12.0 Mac OS X (Intel/x86) Android 6.0 - AOSP 8.0: Mac OS X v10.10 (Yosemite) or later with Xcode 4.5.2 and Command Line Tools Android 5.x: Mac OS X v10.8 (Mountain Lion) with Xcode 4.5.2 and Command Line Tools JDK Android 7.0 - Android 8.0: Ubuntu: OpenJDK 8 Mac OS X: JDK 8u45 or higher Android 5.x (Lollipop) - Android 6.0 (Marshmallow): Ubuntu: OpenJDK 7 Mac OS X: jdk-7u71-macosx-x64.dmg Set up for AOSP development (2.3 - 4.4) This section provides some guidance for how to set up Android 2.3 through Android 4.4. Operating systems Android is typically built with a GNU Linux. It's also possible to build Android in a virtual machine on unsupported systems such as Windows. Google recommends building on GNU Linux. The Android build system normally runs ART on the build machine to precompile system DEX files. ART can run only on Linux, so the build system skips this precompilation step on non-Linux operating systems, resulting in an Android build with reduced performance. GNU Linux Android 2.3.x - Android 4.4: Ubuntu 12.04 (Precise) Mac OS X (Intel/x86) Android 4.1.x - Android 4.4.x: Mac OS X v10.6 (Snow Leopard) or Mac OS X v10.7 (Lion) and Xcode 4.2 (Apple Developer Tools) Android 2.3 - Android 4.0.x: Mac OS X v10.5 (Leopard) or Mac OS X v10.6 (Snow Leopard) and the Mac OS X v10.5 SDK GNU make For Android 4.1.x to 4.4 use GNU make (gmake) 3.82. For Android 2.3 to 4.0.x, revert from gmake 3.82 to avoid build errors. Xcode and other packages For Mac OS X v10.8 or lower, install Xcode from the Apple developer site. If you are not already registered as an Apple developer, you must create an Apple ID to download. If using Mac OS X v10.4, also install Bison: POSIXLY_CORRECT=1 sudo port install bison For MacPorts, issue: POSIXLY_CORRECT=1 sudo port install gmake libsdl git gnupg For Homebrew, issue: brew install gmake libsdl git gnupg2 Revert from gmake 3.82 In Android 4.0.x and lower, gmake 3.82 has a bug that prevents Android from building. You can install version 3.81 using MacPorts with these steps: Edit /opt/local/etc/macports/sources.conf and add file:///Users/Shared/dports above the rsync line. Create the dports directory: mkdir /Users/Shared/dports In the new dports directory, run: svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/ Create a port index for your new local repository: portindex /Users/Shared/dports Install the lower version of gmake: sudo port install gmake @3.81 JDK Android 2.3.x - Android 4.4.x: Ubuntu: Java JDK 6 Mac OS X: Java JDK 6 JDK for Linux The Android Open Source Project (AOSP) comes with prebuilt versions of OpenJDK within prebuilts/jdk/ so no additional installation is required. Earlier versions of Android require a separate installation of the JDK. On Ubuntu, use OpenJDK For Ubuntu 15.04 and higher Run the following: sudo apt-get update sudo apt-get install openjdk-8-jdk For Ubuntu LTS 14.04 There are no available supported OpenJDK 8 packages for Ubuntu 14.04. The Ubuntu 15.04 OpenJDK 8 packages have been used successfully with Ubuntu 14.04. Higher package versions (for example, those for 15.10, 16.04) don't work on 14.04 using the following instructions. Download the .deb packages for 64-bit architecture from old-releases.ubuntu.com openjdk-8-jre-headless_8u45-b14-1_amd64.deb with SHA256 0f5aba8db39088283b51e00054813063173a4d8809f70033976f83e214ab56c0 openjdk-8-jre_8u45-b14-1_amd64.deb with SHA256 9ef76c4562d39432b69baf6c18f199707c5c56a5b4566847df908b7d74e15849 openjdk-8-jdk_8u45-b14-1_amd64.deb with SHA256 6e47215cf6205aa829e6a0a64985075bd29d1f428a4006a80c9db371c2fc3c4c Optionally, confirm the checksums of the downloaded files against the SHA256 string listed with each package from step 1. For example, with the sha256sum tool: sha256sum {downloaded.deb file} Install the packages: sudo apt-get update Run dpkg for each of the .deb files you downloaded. It may produce errors due to missing dependencies: sudo dpkg -i {downloaded.deb file} To fix missing dependencies: sudo apt-get -f install (Optional) Update the default Java version Optionally, for the previously mentioned Ubuntu versions, update the default Java version by running: sudo update-alternatives --config java sudo update-alternatives --config javac Note: During a build, if you encounter version errors for Java, see Wrong Java version for likely causes and solutions. Install required packages for Ubuntu 14.04 Run the following commands to install required packages for Ubuntu 14.04: $ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip$ Install required packages for Ubuntu 12.04 Run the following commands to install required packages for Ubuntu 12.04: $ sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. Last updated 2026-06-17 UTC. [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-17 UTC."],[],[]] Build Android repository Requirements Downloading Preview binaries Factory images Driver binaries Connect @Android on X @AndroidDev on X Android Blog Google Security Blog Platform on Google Groups Building on Google Groups Porting on Google Groups Get help Android Help Center Pixel Help Center www.android.com Google Mobile Services Stack Overflow Issue Tracker About Android Community Legal License Privacy Site feedback Manage cookies English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어