KBEA-00165 - Best Practices for Android Builds Using CloudBees Build Acceleration 10.1 and Newer Versions

Article ID:360032822972
3 minute readKnowledge base

This KB article applies to CloudBees Build Acceleration 10.1 and newer versions. For information about best practices for 10.0 and older versions, see KBEA-00130 - Best Practices for Android Builds Using CloudBees Build Acceleration 10.0 and Older Versions.


This article describes the best practices for running Android builds. It contains the following topics:

  • <<%E2%80%9CRecomAgentDeploySizing%E2%80%9D,Recommended Agent Deployment and Sizing>>

  • <<%E2%80%9CRAM_ForAgentHosts%E2%80%9D,Minimum RAM Requirements for Agent Hosts>>

  • <<%E2%80%9CRequiredPackages%E2%80%9D,Required Packages>>

  • <<%E2%80%9CeMakeOptionsForAndroid%E2%80%9D,eMake Options for Android Builds>>

  • <<%E2%80%9CNotes%E2%80%9D,Notes>>

  • <<%E2%80%9CSupportedVersions%E2%80%9D,Supported Versions>>

  • <<%E2%80%9CSeeAlso%E2%80%9D,See Also>>

For the fastest Android builds, you should have at least 16 Accelerator agents.

Minimum RAM Requirements for Agent Hosts

The minimum recommended total amount of RAM for an agent host is at least 2 GB per CloudBees Build Acceleration agent plus the amount of RAM normally needed by your build. For example, if you run four agents and your build normally needs 16 GB, you need ((2 * 4) + 16) = 24 GB.

Required Installed Packages

The patch utility is required. This is supplied by the Linux distribution in a package named patch on Ubuntu, Fedora, and Red Hat.

To install the package on Ubuntu, enter:

sudo apt-get install patch

To install the package on Fedora, log in as root and enter:

dnf install patch

To install the package on Red Hat, log in as root and enter:

yum install patch -`uname -r`

eMake Options for Android Builds

Using eMake for Android builds requires two eMake options, which you use to specify your Android version and your Android source file location. eMake uses these options to automatically configure the build for best performance and compatibility with Android:


where is 7.0.0, 8.0.0, or 9.0.0



where is the directory path to your source files.

What eMake Options Does --emake-android-version Set Automatically?

The --emake-android-version option sets many build-related command-line options such as parse avoidance and whether to ignore directory read conflicts ("readdir-conflicts"). eMake sets --emake-readdir-conflicts=1 in a learning build to ensure a comprehensive history. In non-learning builds, it is set to 0 for the best performance.

Following is the full list of options that it automatically sets:


Except for the --emake-historyfile option, if you must specify other values for any of these options, you must place those options in the eMake command after the --emake-android-version option so that they are not overridden.

How eMake Detects and "Kickstarts" Android Learning Builds

eMake tries to determine if you lack a history file (if so, the build is a "learning" build). In this case, eMake creates a "kickstart" history file for your Android version to help reduce the build duration.

eMake uses the name that you set for your history file. It also sets --emake-history=create so that the new history from your learning build omits the kickstart history.

Using --emake-android-root for Builds That Do Not Start in the Android Source Root

A build might start with a top-level makefile other than the one belonging to Android. For example, if a makefile contains the following line:

# do some other stuff



    **cd $(ANDROID_ROOT) \&\& $(MAKE)**

Then eMake would be unable to find the original files in the current directory of the top-level Make. To avoid this issue, you should always use the --emake-android-root eMake option to set the path to the Android source files.

Sample eMake Command for an Android Build

Following is an example eMake invocation that uses both Android-specific options:

emake --emake-android-version=9.0.0 --emake-android-root=../AndroidP  -f MyTopLevelMakefile.mk


As of the August 2019 preview release, the Accelerator Android integration supports Android builds that are invoked as components of another build.

Supported Versions

  • Accelerator 10.1

  • Android N, O, and P

See Also