Devesh Rx Logo
Devesh Rx Blog

How to Sign an Android App in Android Studio (Step-by-Step)

August 7, 2026

How to Sign an Android App in Android Studio (Step-by-Step)

You just finished coding, debugging, and polishing your new application. You are ready to share it with the world, but you cannot simply upload a raw project file to the web.

If you try to distribute an unsigned app, Android devices will block the installation entirely. Worse, if you mess up the signing process, you might lose the ability to update your own app in the future.

Thankfully, learning how to sign an Android app is a straightforward process. In this guide, we will walk you through creating a secure digital signature, automating the Android app signing process, and protecting your developer credentials.

Why Do You Need to Sign Your Android App?

At its core, signing your application is a mandatory security practice. It acts as a digital signature that proves you are the authentic creator of the software.

Imagine you want to install a popular browser on your phone. If you download an APK file from a random website, how do you know it isn’t a malicious duplicate? The Android operating system solves this by checking the app’s digital signature.

By taking the time to sign your app, you guarantee three things:

  • Authenticity: Users know the app comes directly from you, the original developer.
  • Integrity: Hackers cannot modify your APK file and redistribute it as their own.
  • Seamless Updates: Android uses your signature to verify that future app updates come from the same developer as the original version.

Step 1: Generate a Signed APK or App Bundle

To start the Android app signing process, you first need to create a Key Store file. This file will securely hold your developer certificates.

Follow these steps to create one inside Android Studio:

  1. Open your project in Android Studio.
  2. Navigate to the top menu and click Build > Generate Signed Bundle / APK.
  3. Choose your format: Select Android App Bundle (.aab) if you are uploading to the Google Play Store. Select APK if you plan to distribute the app via your own website or email.
  4. Click Next.
  5. Under the “Key store path” section, click the Create new button.

Setting Up Your Java Key Store (.jks)

A new window will appear. Fill in the following details to generate your security file:

  • Key Store Path: Choose a secure folder on your computer and name your file (e.g., mysignkey.jks). The JKS extension stands for Java Key Store.
  • Password: Create a strong, memorable password for the Key Store.
  • Alias: Name the specific key you are creating (e.g., myappkey1).
  • Alias Password: Create a separate password for this specific key. For maximum security, do not use your Key Store password.
  • Validity: Set this to a high number (like 999 years) so your certificate never expires.
  • Certificate: Fill in your name, organization, and location details.

Click OK, select Release as your build variant, and click Finish. Android Studio will now generate a signed APK or App Bundle for you!

The Key Store vs. Key Alias Explained

Many beginners get confused by the difference between the Key Store and the Key Alias. Here is an easy way to understand how they work together.

Imagine your Java Key Store (.jks file) is a physical locker. To open this locker, you need your Key Store Password.

Inside that locker, you can store multiple different keys, which are called Aliases. Each key (Alias) can be used to sign a different application, and each requires its own Alias Password.

Pro Tip: Always use different Alias keys for different applications. If one key is compromised, your other apps will remain totally safe.

Step 2: Automate the Android App Signing Process with Gradle

Manually generating a signed APK every time you update your code is exhausting. You can easily automate this by adding a signing configuration to your Gradle build file.

  1. Go to File > Project Structure > Modules.
  2. Click on the Signing Configs tab and hit the + (plus) icon.
  3. Name this new configuration release.
  4. Select your .jks file from your computer.
  5. Enter your Key Store password, Alias name, and Alias password, then click OK.

Configuring the Release Build

Now, you must instruct Android Studio to use this configuration whenever you build the production version of your app.

  1. Stay in the Project Structure menu and navigate to Default Configuration.
  2. Scroll down to Sign Config and select release from the dropdown menu.
  3. Click OK to save your changes.

From now on, whenever you run a release build, Gradle will automatically sign the app for you.

How to Find Your SHA-1 and SHA-256 Fingerprints

If you plan to use backend services like Firebase or Google Maps, you will need your SHA-1 or SHA-256 certificate fingerprints. You don’t need a third-party tool to find these.

Android Studio can generate a signing report for you in seconds:

  1. Open the Terminal window at the bottom of Android Studio.
  2. Type the command: ./gradlew signingReport and press Enter.
  3. Wait a few seconds for the script to run.

The terminal will print out the MD5, SHA-1, and SHA-256 values for both your debug and release keys. Simply copy and paste these into your Firebase console.

Crucial Security Warnings for App Developers

Before you close Android Studio and publish your app, please keep these two vital security rules in mind.

1. Back Up Your .jks File

This is the most critical rule in Android development. Do not lose your .jks file, and do not forget your passwords.

If you lose the signing key used for a Google Play Store app, you will lose the ability to push updates. You would have to create a brand new app listing, which means losing all your current downloads and user reviews.

2. Never Hardcode Passwords

In this tutorial, we entered passwords directly into the Gradle menu for the sake of simplicity. For professional projects, this is incredibly dangerous.

If you upload hardcoded passwords to GitHub, anyone can view them. Instead, store your passwords securely using Environment Variables on your computer, and reference those variables in your Gradle file.

Frequently Asked Questions (FAQs)

What is the difference between an APK and an Android App Bundle (.aab)? An APK is a complete, ready-to-install application file used for manual distribution. An Android App Bundle (.aab) is a publishing format required by the Google Play Store, which Google uses to generate optimized APKs specific to a user’s device.

What happens if I lose my Android keystore file? If you lose your keystore file or forget the passwords, you cannot update your existing app on the Google Play Store. You must contact Google Play Developer Support to request a key reset, which involves generating a new key and proving your identity.

How do I hide my keystore password in my build.gradle file? To hide your keystore passwords, save them in a local.properties file that is excluded from your version control (via .gitignore). You can then write a script in your build.gradle file to read the passwords directly from that local file.


📌 Full Course Playlist https://www.youtube.com/playlist?list=PLO1OrQEU0vHNmD9Xqzs-qXwzzwrDvdhVu

#Tutorial
0 Introduction
1 Setting up Android Studio IDE
2 Mastering Android Studio: Navigating the IDE & Project Structure
3 Android Activity & Lifecycle Explained
4 Android Services: Background, Foreground, and Bound Services Explained
5 Android Broadcast Receivers: The Complete Guide to Listening and Sending Events
6 Android Content Provider API Tutorial: Access User Data Safely (Kotlin)
7 How to Build UI with Jetpack Compose: A Beginner’s Guide
8 Android Runtime Permissions in Kotlin and Jetpack Compose: Step-by-Step Guide
9 Android Intents Guide: Master Screen Navigation and Data Sharing
10 Android Room Database: Complete CRUD Tutorial with Kotlin
11 Android Internal Storage: File I/O Tutorial
12 Android MediaStore API Tutorial: How to Save and Read Files
13 Master Storage Access Framework in Jetpack Compose
14 How to Create Android Notifications with Jetpack Compose & Kotlin
15 How to Use SharedPreferences in Android (Kotlin & Compose)
16 OkHttp Android Tutorial: Complete Kotlin Guide
17 Android MediaPlayer API: Build a Robust Audio Player
18 Android Media3 ExoPlayer: Jetpack Compose Video Guide
19 Essential ADB Commands Guide for Android Developers
20 How to Sign an Android App in Android Studio (Step-by-Step)

References

The official Android Developer Documentation on App Signing: https://developer.android.com/studio/publish/app-signing

~ ~ THANK YOU FOR READING ~ ~

Share: