# Generate Android APKs & App Bundles

## Overview

Follow the steps on this page to build the APK and IPA for deploying in Play Store and App-store.

## Steps

### Generate APK For Testing

1. Follow the [Flutter Installation and setup Guide](https://docs.digit.org/platform/guides/developer-guide/flutter-mobile-app-ui-developer-guide/setup-development-environment/flutter-installation-and-setup-guide) and [Run the Application](https://docs.digit.org/platform/guides/developer-guide/flutter-mobile-app-ui-developer-guide/setup-development-environment/run-application) till the Flutter pub is set up.
2. Run the below command in your terminal from theroot of the project to generate the APK

   **`flutter build apk --release`**

<figure><img src="https://lh5.googleusercontent.com/i5RVBw4Xi1kLQZJ3Lv6kmAx-wjDKcVgIeq_1Xg-Dc5ksIzR1CHSNyI7ed7zYwva79eU6nenF837ZsNhNU29XAq4vbhS1BaETLUFmzDRc4zBVpSQTsZhfx-56rp3QqMBJnzJrK80sST5Do6DYOyduVls" alt=""><figcaption></figcaption></figure>

### Generate & Publish App Bundle To Play Store

#### Pre-requisites

* Prior knowledge of generating unique key store files for your application ( Reference links: [Generating key store for your Android application](https://docs.oracle.com/cd/E35822_01/server.740/es_admin/src/tadm_ssl_jetty_keystore.html))
* Changing the App name
* Changing App Logo (Ref Link: [Changing app logo in Flutter](https://www.geeksforgeeks.org/flutter-changing-app-icon/))
* Prior knowledge of app bundle creation for publishing in the Play Store
* Terms and Conditions and Privacy Documents for your application

{% hint style="info" %}
**Note:** The generated key store file needs to be added to the Android/app folder of your project. This is needed for publishing the next version of your application.

<img src="https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2Fgit-blob-a19f1722521000b9fa757b5fb55411755690ec2f%2Fimage.png?alt=media" alt="" data-size="original">
{% endhint %}

#### Steps

1. Add a key.properties file inside your Android folder which is a reference to your key store file. Below is the sample key.properties file.

```
storePassword=muktasoft
keyPassword=muktasoft
keyAlias=upload
storeFile=muktasoft.jks
```

2. Run the below command in your terminal from the root of the project to generate the App bundle to publish in the play store.

**`flutter build app bundle`**

<figure><img src="https://3868804918-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FegsIWleSdyH9rMLJ8ShI%2Fuploads%2Fgit-blob-4bf1cd514580a848f1608982ca72b0069a812b21%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
