# Build and release an Android app

### Signing the app <a href="#signing-the-app" id="signing-the-app"></a>

To publish on the Play Store, you need to give your app a digital signature. Use the following instructions to sign your app.

#### Create a keystore <a href="#create-a-keystore" id="create-a-keystore"></a>

If you have an existing keystore, skip to the next step. If not, create one by running the following at the command line:

On Mac/Linux, use the following command:

```
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
```

On Windows, use the following command:

```
keytool -genkey -v -keystore c:\Users\USER_NAME\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key
```

This command stores the `key.jks` file in your home directory. If you want to store it elsewhere, change the argument you pass to the `-keystore` parameter. **However, keep the `keystore` file private; don’t check it into public source control!**

#### Reference the keystore from the app <a href="#reference-the-keystore-from-the-app" id="reference-the-keystore-from-the-app"></a>

**Go to** `<app dir>/android/key.properties` change your keystore reference:

![](https://3055596817-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFydntNulzdMw3Es2MW%2F-MFzPtK6JEJ-k0Kcg2w4%2F-MFzT0IERwiSGwDZXzOq%2Fscreenshot_21.png?alt=media\&token=d4b95c80-9a2a-4532-9c6d-19fefc1a8599)

### Building the app for release <a href="#building-the-app-for-release" id="building-the-app-for-release"></a>

**command line for appbundle:**

1. Enter `cd <app dir>`\
   (Replace `<app dir>` with your application’s directory.)
2.

````
```
````

````
flutter build appbundle --release
```
````

The release bundle for your app is created at `<app dir>/build/app/outputs/bundle/release/app.aab`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://taketok.gitbook.io/taketok/build-and-release-an-android-app.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
