Skip to content

bitrise-steplib/bitrise-step-android-build-for-ui-testing

Repository files navigation

Android Build for UI Testing

Step changelog

Builds your Android project with Gradle with the belonging AndroidTest variant.

Description

This Step generates all the APKs you need to run instrumentation tests for your Android app: both an APK from your app and the belonging test APK, for example, :app:assembleDemoDebug, :app:assembleDemoDebugAndroidTest

Configuring the Step

  1. Add the Project Location which is the root directory of your Android project.
  2. Set the Module you want to build. To see your available modules, open your project in Android Studio and go to Project Structure and see the list on the left.
  3. Set the Variant you want to build. To see your available variants, open your project in Android Studio and go to Project Structure and then the variants section. Under Options:
  4. Set the APK location pattern: Once the build has run, the Step finds the APK files with the given pattern.
  5. Set the level of cache where all caches build cache and dependencies, only_deps caches dependencies only, none does not cache anything.
  6. If you wish to pass any extra Gradle arguments to the gradle task, you can add those in the Additional Gradle Arguments input.

Useful links

Related Steps

🧩 Get started

Add this step directly to your workflow in the Bitrise Workflow Editor.

You can also run this step directly with Bitrise CLI.

⚙️ Configuration

Inputs
Key Description Flags Default
project_location The root directory of your android project, for example, where your root build gradle file exist (also gradlew, settings.gradle, etc...) required $BITRISE_SOURCE_DIR
module Set the module to build. Valid syntax examples: app, feature:nested-module To see your available modules please open your project in Android Studio and go in [Project Structure] and see the list on the left. required
variant Set the variant that you want to build. To see your available variants please open your project in Android Studio and go in [Project Structure] -> variants section. required
apk_path_pattern Will find the APK files with the given pattern. required */build/outputs/apk/*.apk
cache_level all - will cache build cache and dependencies only_deps - will cache dependencies only none - will not cache anything required only_deps
arguments Extra arguments passed to the gradle task
Outputs
Environment Variable Description
BITRISE_APK_PATH This output will include the path of the generated APK after filtering based on the filter inputs.
BITRISE_TEST_APK_PATH This output will include the path of the generated test APK after filtering based on the filter inputs.

🙋 Contributing

We welcome pull requests and issues against this repository.

For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.

Learn more about developing steps: