diff --git a/docs/android/get_started.md b/docs/android/get_started.md index 77cad6a6..ca6291be 100644 --- a/docs/android/get_started.md +++ b/docs/android/get_started.md @@ -75,6 +75,10 @@ You will need the `JAVA_HOME` environment variable set to a JDK. We are currentl gradlew.bat assembleDebug ``` +:::info +If you need to create a release build, follow the [release build instructions](/docs/android/tips/release). +::: + ## Firebase setup Firebase is used for notifications. If you don't need these features, you should use a mocked Firebase configuration. diff --git a/docs/android/release.md b/docs/android/release.md index 56c68539..0b042335 100644 --- a/docs/android/release.md +++ b/docs/android/release.md @@ -23,6 +23,10 @@ This document outlines the steps to take an Android application from development - The CI builds the **release application**. - The release build is pushed to the **internal tester group** on both the Google Play Store and Firebase. +:::note +You can download pre-built APKs for every commit on the `main` branch from the [GitHub Actions page](https://github.com/home-assistant/android/actions/workflows/onPush.yml). +::: + ### Internal testing - Internal testers validate the release build to ensure functionality. @@ -33,9 +37,17 @@ This document outlines the steps to take an Android application from development - Every week, the latest version of the `main` branch is pushed to the **open beta** channel. - Open beta users help test the application in real-world scenarios and report issues. +:::note +You can join the beta program directly through the [Google Play Store](https://play.google.com/apps/testing/io.homeassistant.companion.android). +::: + ### Production release -- If the beta version is stable and approved by maintainers, it is promoted to **production**, making it available to all users. +If the beta version is stable and approved by maintainers, it is promoted to **production**, making it available to all users. + +:::note +You can find the app on the [Google Play Store](https://play.google.com/store/apps/details?id=io.homeassistant.companion.android). +::: ## Google Play Store validation diff --git a/docs/android/tips/release.md b/docs/android/tips/release.md new file mode 100644 index 00000000..465ac3e1 --- /dev/null +++ b/docs/android/tips/release.md @@ -0,0 +1,71 @@ +--- +title: "Build for release" +sidebar_label: "Build for release" +--- + +:::warning +Ensure the keystore is securely stored and not included in version control. It also applies for the credentials. +::: + +## Building for release + +To build the app for publishing, you need to sign it. Follow these steps: + +### Step 1: Create or use an existing keystore + +Before building the app, you must have a keystore. You can either create a new one or use an existing keystore. + +#### Creating a keystore + +You can create a keystore directly from Android Studio: + +1. Go to **Menu** > **Build** > **Generate Signed APK**. +2. Select the option to create a new keystore. +3. **Remember the passwords and the key alias** for future use. + +#### Using an existing keystore + +If you already have a keystore, ensure it is named `release_keystore.keystore` and placed in the following folders: +- `app` +- `wear` + +Alternatively, you can specify a custom location by setting the `KEYSTORE_PATH` environment variable. + +--- + +### Step 2: Build the app + +You can build the app using either Android Studio or the command line (CLI). + +#### From Android Studio + +1. Open Android Studio. +2. Go to **Menu** > **Build** > **Generate Signed APK**. +3. Select the keystore you created or an existing one. +4. Follow the steps to build the app. + +#### From the CLI + +1. **Set environment variables** + Define the following environment variables used in `app/build.gradle.kts`: + - `KEYSTORE_PASSWORD` + - `KEYSTORE_ALIAS` + - `KEYSTORE_ALIAS_PASSWORD` + - `KEYSTORE_PATH` (if your keystore is located in a custom location) + +2. **Build the app** + To build the APK, run: + + ```bash + ./gradlew assembleRelease # To build all the apps + # OR + ./gradlew ::assembleRelease # To build a specific module, such as :app, :automotive, or :wear + ``` + + To build the AAB, run: + + ```bash + ./gradlew bundleRelease # To build all the apps + # OR + ./gradlew ::bundleRelease # To build a specific module, such as :app, :automotive, or :wear + ``` diff --git a/sidebars.js b/sidebars.js index cd53e355..da54e5ae 100644 --- a/sidebars.js +++ b/sidebars.js @@ -347,6 +347,7 @@ module.exports = { "android/tips/lollipop_emulator", "android/tips/fcm_push_notification", "android/tips/sarif_reports", + "android/tips/release", ], }, "android/best_practices",