Android Build Process

      1 Comment on Android Build Process

There are a lot of steps involved in android build process. We will discuss them one by one. But before jumping to the explanation lets take a look at the below diagram first where I have tried to put all the steps of build process together.

Android Build Process

AAPT Tool

AAPT stands for android assets packaging tool. This tool comes with the Android SDK and present in $ANDROID_HOME/platform-tools/. It takes all the resources present in the res/ directory and compiles them. It generates a R.java file which contains ids of all the resources. Once you have installed the Android SDK you can directly execute the aapt commands.

Android Build Process Steps

  1. AAPT takes all the resources present in res/ directory and AndroidManifest.xml(meta data of android app) and compiles all the resources. It creates a R.java class which has all the resource ids.
  2. Then all the java files including R.java gets compiled into byte code.
  3. Android application runs on dalvik vm so the byte code is cross compiled to the Dalvik byte code (.dex file)
  4. The .dex file and the compiled resources together forms the .apk file.
  5. Generated apk file is a debug build, to make a release build we need to sign the apk file using a key. You can do this from Android Studio.sign_apk_file
  6. Once you sign the apk file it will be ready to use in production.

One thought on “Android Build Process

Leave a Reply

Your email address will not be published. Required fields are marked *