How to build OpenSTDroid distribution

Revision as of 17:13, 16 July 2024 by Registered User
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Applicable for STM32MP25x lines


This article explains how to build the OpenSTDroid distribution. It is intended for Distribution Package users.

1. Prerequisites[edit source]

The environment must be installed using the Distribution Package adapted to your microprocessor device.

In addition follow the PC prerequisites dedicated to Android to make sure all the packages required to use the environment are present.

2. Build[edit source]

First execute the following command:

 source ./build/envsetup.sh

It sets several required environment variables for the build and adds several useful scripts in your path. It is mandatory to start with this command as soon as you are using a new terminal.

Use the command below to list some interested aliases created by envsetup.sh:

 hmm 


If this is the first time you set up an environment to build Android, continue to read this article. Otherwise directly go to Choosing a build target.

2.1. Setup[edit source]

Execute this <STM32Series> setup only once, for example for STM32MP2 Series:

 stm32mp2setup

It applies specific patches related to your <STM32Series> to customize Android and load the necessary libraries and modules.

2.2. Choosing a build target[edit source]

To choose your target device, execute the command below:

 lunch aosp_<BoardId>-<build_type>

The available build_type values are the following:

  • user: to generate an end-user production image;
  • userdebug: similar to an user build but with root access and debug capabilities;
  • eng: development configuration with additional debugging tools.

2.3. Generating the image[edit source]

Warning white.png Warning

In case you selected user build, it's required to rebuild the kernel as the prebuilt images are not compatible (see How to build kernel for Android)

You are now ready to build. To do this, just launch the command:

 make -j

Depending on your computer settings, several hours might be required to execute this command on the first build.

The result can be found in the out folder. The generated partition images are located in out/target/product/<BoardId>.

To flash images, refer to Flashing the built image.