During development process, you would typically use plain make with no particular target to compile Android sources. (See Build your development images.) However, when you prepare for release, you must use the target dist to generate the proper release images. To do so, follow these steps:

  1. Set up your environment and install the sources. If you have not already done so, see Set up your development computer and Install Digi Embedded for Android.

  2. Change to the directory where the source code is installed.

    $ cd dea-9.0-r3
  3. Initialize the build environment:

    $ source build/envsetup.sh
  4. Select a ConnectCore 8X target to build:

    • ccimx8xsbcpro-user creates images with no root access, suitable for production.

    • ccimx8xsbcpro-userdebug like user images but with root access and debug capability.

      Information about the selected target is displayed:

      $ lunch ccimx8xsbcpro-userdebug
      
      ============================================
      PLATFORM_VERSION_CODENAME=REL
      PLATFORM_VERSION=9
      TARGET_PRODUCT=ccimx8xsbcpro
      TARGET_BUILD_VARIANT=userdebug
      TARGET_BUILD_TYPE=release
      TARGET_ARCH=arm64
      TARGET_ARCH_VARIANT=armv8-a
      TARGET_CPU_VARIANT=cortex-a53
      TARGET_2ND_ARCH=arm
      TARGET_2ND_ARCH_VARIANT=armv7-a-neon
      TARGET_2ND_CPU_VARIANT=cortex-a9
      HOST_ARCH=x86_64
      HOST_2ND_ARCH=x86
      HOST_OS=linux
      HOST_OS_EXTRA=Linux-5.0.0-32-generic-x86_64-Ubuntu-18.04.3-LTS
      HOST_CROSS_OS=windows
      HOST_CROSS_ARCH=x86
      HOST_CROSS_2ND_ARCH=x86_64
      HOST_BUILD_TYPE=release
      BUILD_ID=dea-9.0-r3.1
      OUT_DIR=out
      ============================================
      $
  5. Use dist target to generate the release images:

    $ make -j<Number_Of_Jobs> dist

    It compiles the whole source tree, as a plain make does. Then it generates several zip files inside the out/dist folder of the dea-9.0-r3 directory:

    • ccimx8xsbcpro-target_files-<build_id>.zip contains all the target files (apk, binaries, libraries, etc.) that will go into the final release package.

      You will use this file later on to get privately signed artifacts. The next step is to Sign for release.

    • ccimx8xsbcpro-ota-<build_id>.zip is an OTA update package that can be installed through recovery. It is a full update package with all the files needed by system, boot, vendor, and recovery partition.

      You can use it during testing or development, but not as a final distributable artifact as it is signed with non-private keys.

    • ccimx8xsbcpro-apps-<build_id>.zip contains all the apks.

    • ccimx8xsbcpro-img-<build_id>.zip contains image files for system, boot, vendor, and recovery.

      The images inside are using test-keys, use them only for development purposes.

    • ccimx8xsbcpro-symbols-<build_id>.zip contains all files in out/target/product/ccimx8xsbcpro/symbols.

    • otatools.zip includes all the required scripts, binaries, and libraries to get the release artifacts from ccimx8xsbcpro-target_files-<build_id>.zip without installing the complete Android sources. See Release in a secure environment.

All these files are signed using test-keys. These keys are insecure because they are distributed with the code. For this reason, this generated files should not be use for production.

You must sign the ccimx8xsbcpro-target_files-<build_id>.zip file with your own private key to, later, generate your release images and/or update package. See Sign for release.