The goal of this post is to explain what happens when you select Run on your Android project.
In short, there are two major steps: Building and Deploying, and those steps are also divided in several stages, like Compiling, Linking, Packaging, etc. The following schema shows the biggest steps.
- Compiling: Produces the object files of your application
- Linking: Uses the object files to produce the final executable, for Android, a dynamic library (.so)
- Packaging: Creates the .apk file containing the binaries and any metadata needed
- Signing: Signs the .apk file, using a debug keystore or a release keystore you provide
- Zipalign: Aligns the .apk according to the Android specifications
On this article I’m not explaining how the .apk is deployed to the device, and how is run, that will be shown later.
If you are curious about what’s going on under the hood, you can always use the Messages window to get a list of all the commands issued in the process.