Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ For more information on the inputs of the steps and how the variables in the fol
| AC_ANDROID_ALIAS | Selected alias name. |
| AC_ANDROID_ALIAS_PASSWORD | Selected alias password. |
| AC_V2_SIGN | Specifies if signing will use V2. |
| AC_ANDROID_POST_PROCESS_OUTPUT_PATH | Path to the output file generated by the [Android Post-Processing](/workflows/android-specific-workflow-steps/post-processor) step. |
| AC_ANDROID_POST_PROCESS_OUTPUT_PATH | Path to the output file generated by the [Android Post-Processing](/workflows/android-specific-workflow-steps/app-post-processor) step. |
| JAVA_HOME | Directory path of the Java JDK installation. |
| JAVA_OPTS | Options for Java arguments. For example: `-Xms1536M -Xmx9216M` |
| JAVA_VERSION | Version of the Java JDK installed. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Android Build for UI Testing
description: Learn how to use the Android Build for UI Testing workflow step in Appcircle
tags: [android, mobile, android, ui testing, testing]
tags: [android, mobile, ui testing, testing]
---

import Screenshot from '@site/src/components/Screenshot';
Expand All @@ -12,53 +12,59 @@ The **Android Build for UI Testing** workflow step is tailored to [build your An

Comment thread
boztopuz marked this conversation as resolved.
### Prerequisites

The workflow steps that need to be executed before running the **Android Build for UI Testing** workflow step, along with their respective reasons, are listed in the table below.
Before running the **Android Build for UI Testing** step, you must complete certain prerequisites, as detailed in the table below:

| Prerequisite Workflow Step | Description |
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**Git Clone**](https://docs.appcircle.io/workflows/common-workflow-steps/#git-clone) | To initiate the **Android Build for UI Testing** process, the repository that needs to be built must be fetched from the branch. This is achieved as follows: Upon completion of the **Git Clone** step, it generates the `AC_REPOSITORY_DIR` variable, which is then used as the input for the **Android Build for UI Testing** step. |
| [**Git Clone**](/workflows/common-workflow-steps/git-clone) | To initiate the **Android Build for UI Testing** process, the repository that needs to be built must be fetched from the branch. This is achieved as follows: Upon completion of the **Git Clone** step, it generates the `$AC_REPOSITORY_DIR` variable, which is then used as the input for the **Android Build for UI Testing** step. |

:::caution

If you're updating the version via Appcircle, ensure that the following step comes before the **Android Build for UI Testing** step:

- [**Android Increment Build and Version Number**](https://docs.appcircle.io/workflows/android-specific-workflow-steps/increment-build-and-version-number)
- [**Android Increment Build and Version Number**](/workflows/android-specific-workflow-steps/increment-build-and-version-number)

:::

:::caution

If you're working with a **React Native Android** project, ensure that the following steps come before the **Android Build for UI Testing** step:

- [**Install Node**](https://docs.appcircle.io/workflows/react-native-specific-workflow-steps/#install-node)
- [**NPM/Yarn Commands**](https://docs.appcircle.io/workflows/react-native-specific-workflow-steps/npm-yarn-commands)
- [**Install Node**](/workflows/react-native-specific-workflow-steps/node-install)
- [**NPM/Yarn Commands**](/workflows/react-native-specific-workflow-steps/npm-yarn-commands)

:::

<Screenshot url='https://cdn.appcircle.io/docs/assets/android-workflow-components-android-build-for-ui-testing_1.png'/>

:::note
The **[Firebase Test Lab for Android](https://docs.appcircle.io/continuous-testing/firebase-test-lab-for-android/)** step has been added as an example. You can use the APK you produce for UI testing in any component you choose.

The **[Firebase Test Lab for Android](/workflows/android-specific-workflow-steps/firebase-test-lab)** step has been added as an example. You can use the APK you produce for UI testing in any component you choose.

:::

### Input Variables

For each component, specific input variables are required for its operation on your system. The input variables necessary for the **Android Build for UI Testing** are as follows:
This step contains some input variable(s). It needs these variable(s) to work. The table below gives explanation for this variable(s).

<Screenshot url='https://cdn.appcircle.io/docs/assets/android-workflow-components-android-build-for-ui-testing_2.png' alt="image2" />

| Variable Name | Description | Status |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `$AC_REPOSITORY_DIR` | This variable represents the path of the cloned Git repository. If this step runs after the [Git Clone](https://docs.appcircle.io/workflows/common-workflow-steps/#git-clone) step, the variable will be automatically populated. | Required |
| `$AC_MODULE` | This variable specifies the project module to be built. This variable can also be set via the build [Configuration](https://docs.appcircle.io/build/build-process-management/build-profile-configuration/). In Android Studio, you can locate the available modules for your project. For more information, please refer to this [Android document](https://developer.android.com/studio/projects#ApplicationModules). | Required |
| `$AC_REPOSITORY_DIR` | This variable represents the path of the cloned Git repository. If this step runs after the [Git Clone](/workflows/common-workflow-steps/git-clone) step, the variable will be automatically populated. | Required |
| `$AC_MODULE` | This variable specifies the project module to be built. This variable can also be set via the build [Configuration](/build/build-process-management/build-profile-configuration). In Android Studio, you can locate the available modules for your project. For more information, please refer to this [Android document](https://developer.android.com/studio/projects#ApplicationModules). | Required |
| `$AC_PROJECT_PATH` | Specifies the project path. If your project that needs to be built is **not located** in the root directory where it was cloned from Git, you should provide the subpath as a relative path. | Optional |

### Output Variables

The outputs that can result from the operation of this component are listed as follows:
The output(s) resulting from the operation of this component are as follows:

| Variable Name | Description |
| ------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `$AC_APK_PATH` | Path for the generated **APK** file. This path will be created after the **Android Build for UI Testing** step runs. |
| `$AC_TEST_APK_PATH` | Path for the generated `*androidTest.apk` file. This output can be utilized wherever necessary for UI testing. |
| `AC_APK_PATH` | Path for the generated **APK** file. This path will be created after the **Android Build for UI Testing** step runs. |
| `AC_TEST_APK_PATH` | Path for the generated `*androidTest.apk` file. This output can be utilized wherever necessary for UI testing. |

---

To access the source code of this component, please use the following link:

Expand Down
Loading