I've found a good article on how the Android build process works, which shows the following process:
However, I've also seen another article which says that it uses javac
to convert all files to .class
files, then the dx tool
in the adk
converts all .class
files to classes.dex
, like so:
Please can someone clarify which one is correct?
All APKs require a digital signature before they can be installed or updated on your device. For Debug builds, Android Studio automatically signs the app using the debug certificate generated by the Android SDK tools when we run. A debug Keystore and a debug certificate is automatically created.
The Android build system is the toolkit you use to build, test, run and package your apps. The build system can run as an integrated tool from the Android Studio menu and independently from the command line. You can use the features of the build system to: Customize, configure, and extend the build process.
As we all know, Android apps can be written in Java and Kotlin programming languages. So the process of Android app compilation is based on the compilation process of Java and Kotlin code (aside from Android environment).
To generate a signed APK file, open the Build menu from the toolbar and select Generate Signed Bundle/APK. This opens up a screen where you have to select between creating an Android App Bundle and creating an APK file. Check the APK radio button and proceed to the next window.
You can take a look at the official document Building and Running http://developer.android.com/tools/building/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With