This guide explains how to integrate CarToolForge into an Android System Image as a prebuilt, privileged application.
Follow these steps to integrate:
- Copy the current directory (
cartoolforge) to the path$ANDROID_BUILD_TOP/vendor/autoharness/packages/apps.
Note
The path can be adjusted according to your project's source code organization; the one provided here is for example purposes only.
-
To ensure the application is included in your system image, add
CarToolForgePrebuiltto thePRODUCT_PACKAGESvariable in your target product's makefile.For example, you would add the following to
$ANDROID_BUILD_TOP/packages/services/Car/car_product/build/car_product.mk:PRODUCT_PACKAGES += \ CarToolForgePrebuilt \For Android 17+, if you need to debug allowlist and permissions, you can also add
CarToolForgeStubAllowlistServiceandCarToolForgeStubAllowlistServiceOverlayto the list:PRODUCT_PACKAGES += \ CarToolForgeStubAllowlistService \ CarToolForgeStubAllowlistServiceOverlay \
Note
CarToolForgeStubAllowlistService and CarToolForgeStubAllowlistServiceOverlay are provided for reference and debugging purposes only. Do not include them in final production builds.
-
Compile the system image. Build the AOSP source code from the root directory:
source build/envsetup.sh && lunch <your_target_product> && m -j$(nproc)
Note
In the command above, replace <your_target_product> with the actual target for your build product (e.g., sdk_car_x86_64-aosp_current-userdebug).
After the build completes, verify that the CarToolForgePrebuilt directory and its APK are located in the output directory: $ANDROID_PRODUCT_OUT/system/priv-app/.
- Flash the newly built system image onto your target device. Once the device boots, confirm that the
CarToolForgeis installed and working correctly.