Accelerating Android OS Builds (AOSP)

For all supported AOSP versions, Incredibuild Linux provides a customized ib_profile.xml file, which is designed for each version separately. Before you run an AOSP build, you need to locate the appropriate ib_profile.xml file for your AOSP version, and copy it to your project directory. Then, you can run your AOSP builds with Make.

Executing AOSP Builds

Before you execute AOSP builds, there are certain actions you need to perform in order to prepare your Incredibuild Environment for the executions.  

  1. Find and use the predefined ib_profile.xml file

    1. Locate the ib_profile.xml file

      /opt/incredibuild/data/custom_profiles/android/9-13/

    2. Copy this ib_profile.xml file to your project directory, where the ib_console will run. For example:

      sudo cp /opt/incredibuild/data/custom_profiles/android/9-13/ib_profile.xml ~/Android/Project_Directory/ib_profile.xml

  2. If you are using AOSP without any modifications (vanilla), create a batch file to initialize certain environment variables. If you are using a different shell, create a similar file (named m_droid.sh in the example below) that is suited to your shell with the following commands:

    Copy
    #!/bin/bash
    source build/envsetup.sh
    lunch aosp_arm-eng
    m droid -j 200

Replace 200 with the number of processes to run in parallel in your environment.

You can now execute builds with Incredibuild Linux by running AOSP builds with Incredibuild Linux as follows:

ib_console ./m_droid.sh

Troubleshooting AOSP Builds

If you are having issues with AOSP 10 and higher, verify that the config file sets the size of the shared memory that will be used by the running builds. This setting is sometimes needed for the execution of AOSP 10 and higher sandbox. Unlike other AOSP versions, AOSP 10 and higher have limitations on the size of shared memory that can be used. Therefore, you may need to explicitly set the memory size, and not to use the default size.

  1. Go to: /opt/incredibuild/settings/initiatorShmMaxSize.config. If this file does not exist, please create it.

  2. Verify that the file includes the number 300. This is the maximum memory size in MB that will be allocated to AOSP 10 and higher builds.

Note:
  • Do NOT enter "MB" into the file, only the number of the memory size.

  • Generally, the shared memory size can be between 200 MB and 1 GB. However, it is important to set it to 300 in this case.