Open In App

Methods of Generating APK of Android Application

Last Updated : 25 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

An APK (Android Package Kit) is the file format for applications used on Android devices. After creating the required application one must compile it in APK format to upload it on Google Play. There are two methods through which APK files for an application are generated.

First are the debug APK files that are generated only for testing purposes. They will run on your Android device. However, they cannot be uploaded to Google Play Store or made available to the public. But these APK files can also be personally distributed to other Android users for installation on their devices. Android users can grant permission to their devices to install unknown apps if they want to access APK files from another source and install them directly.

Second, are the signed APK files that come in handy when the application has already been tested and is ready to be uploaded on the Google Play Store and released to the public. Signed APK is secured by a KeyStore credential made by the developer and includes a password for security purposes.

Generating a Debug APK file

Step 1: After building a project/application that you want to import into an APK file go to Build > Build Bundle(s)/APK(s) > Build APK(s) from the toolbar menu.

 

Output:

Android Studio will take a few minutes to generate the APK file. Once the APK file build is complete, you’ll receive a notification on the bottom right corner of your screen. Select Locate and you will find the APK file location. If you miss the notification, you can still find the APK file within the project folder: app/build/outputs/apk/debug. The file by default is named app-debug.apk.

 

Generating  a Signed APK File

Step 1: Sign in to your Google Account as shown below. If you are already logged in move to the next step.

 

Step 2:  From the toolbar, click on the ‘Build’ option and select the ‘Generate Signed Bundle / APK …’ as shown in the image below.

 

Step 3: Now on the appeared pop-up window select ‘APK’ in the radio button as shown in the image below. Then, click on the ‘Next’ button.

 

Step 4: Now Create a new KeyStore credential for your App by clicking on “Create New”.

 

Step 5: In ‘New Key Store’, browse a ‘Key store path’ by clicking on the Folder icon as shown. Then, provide a ‘Password’ and ‘Confirm’ password. Now, on the ‘Key’ section, provide an ‘Alias:’ or go with the already provided one. After that enter a ‘Password’ and ‘Confirm’ password. After that, you can move on to the ‘Certificate’ section. here, provide your ‘First and Last Name’. Enter your address details. After you have provided the required details, click on the ‘OK’.

 

Step 6: You will see the path for your KeyStore with the password you gave. Click on next.

Step 7: On the pop-up window select Release and end the process by clicking on Finish as shown below.

 

Output:

Android Studio will take a few minutes to generate the APK file. Once the APK file build is complete, you’ll receive a notification on the bottom right corner of your screen. Select Locate and you will find the APK file location. The Signed APK file is by default named app-release.apk. You will find it in the project folder in the app/release directory.  

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads