automotive

How to Check the Android Version in Source Code

chanbae 2024. 11. 12. 07:05

When you download the AAOS (Android Automotive OS) or AOSP (Android Open Source Project) source code using the repo tool, you’ll find hundreds of repositories. While it’s possible to check the Android version by looking at the branch name, a more accurate way is to locate the BUILD_ID defined within the code and match it with the version name provided on the official Android website. This allows you to determine the exact version and release date.

 

The BUILD_ID can be found in the build/core/build_id.mk file as follows.

BUILD_ID=AP2A.240705.005.A1

 

AP2A.240705.005.A1 is the actual ID, and by checking this link, you can find that it corresponds to version android-14.0.0_r54, which was released on July 5, 2024.

 

Of course, it’s also possible to retrieve the Android version at runtime or within an app by calling the API, but today I introduced a simple way to check it directly within the source code.