Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ATD emulator tags #35

Merged
merged 7 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

[![Step changelog](https://shields.io/github/v/release/bitrise-steplib/steps-avd-manager?include_prereleases&label=changelog&color=blueviolet)](https://github.com/bitrise-steplib/steps-avd-manager/releases)

Create an Android emulator with the AVD Manager Step.
Create and boot an Android emulator used for device testing

<details>
<summary>Description</summary>

Test your project in an Android emulator with the AVD Manager. Once some basic inputs are set, the Step checks the requirements, downloads and installs the packages before creating and starting the emulator.
Run instrumented and UI tests on a virtual Android device. Once some basic inputs are set, the Step checks the requirements, downloads the selected system image before creating and starting the emulator.

### Configuring the Step
1. Add the **AVD Manager** Step to your Workflow as one of the first Steps in your Workflow.
2. Set the **Device Profile** to create a new Android virtual device. To see the complete list of available profiles, use the `avdmanager list device` command.
2. Set the **Device Profile** to create a new Android virtual device. To see the complete list of available profiles, use the `avdmanager list device` command and use the `id` value for this input.
3. Set the **Android API Level**. The new virtual device will run with the specified Android version.
4. Select an **OS Tag** to have the required toolset on the new virtual device.

Some system images are pre-installed on the virtual machines. In this case the step won't have to spend time downloading the requested image. To check the list of pre-installed images for each stack, visit the [system reports](https://github.com/bitrise-io/bitrise.io/tree/master/system_reports)

### Troubleshooting
The emulator needs some time to boot up. The earlier you place the Step in your Workflow, the more tasks, such as cloning or caching, you can complete in your Workflow before the emulator starts working.
We recommend that you also add **Wait for Android emulator** Step to your Workflow as it acts as a shield preventing the AVD Manager to kick in too early. Make sure you add the **Wait for Android emulator** Step BEFORE the Step with which you want to use the **AVD Manager**.
Expand Down Expand Up @@ -42,7 +44,7 @@ You can also run this step directly with [Bitrise CLI](https://github.com/bitris

| Key | Description | Flags | Default |
| --- | --- | --- | --- |
| `profile` | Set the device profile to create the new AVD. This profile contains all the parameters of the devices. To see the complete list of available profiles please use the `avdmanager list device` command. | required | `pixel` |
| `profile` | Set the device profile to create the new virtual device. This profile contains all the parameters of the devices. To see the complete list of available profiles use the `avdmanager list device` command locally and use the `id` value for this input. | required | `pixel` |
| `api_level` | The device will run with the specified version of android. | required | `26` |
| `tag` | Select OS tag to have the required toolset on the device. | required | `google_apis` |
| `abi` | Select which ABI to use running the emulator. Availability depends on API level. Please use `sdkmanager --list` command to see the available ABIs. | required | `x86` |
Expand Down
2 changes: 1 addition & 1 deletion bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ format_version: "11"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

workflows:
generate-readme:
generate_readme:
steps:
- git::https://github.com/bitrise-steplib/steps-readme-generator.git@main: { }

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type config struct {
AndroidHome string `env:"ANDROID_HOME"`
AndroidSDKRoot string `env:"ANDROID_SDK_ROOT"`
APILevel int `env:"api_level,required"`
Tag string `env:"tag,opt[google_apis,google_apis_playstore,android-wear,android-tv,default]"`
Tag string `env:"tag,opt[google_apis,google_apis_playstore,aosp_atd,google_atd,android-wear,android-tv,default]"`
DeviceProfile string `env:"profile,required"`
CreateCommandArgs string `env:"create_command_flags"`
StartCommandArgs string `env:"start_command_flags"`
Expand Down Expand Up @@ -175,7 +175,7 @@ func main() {

{
"Updating system-image packages",
command.New(sdkManagerPath, "--verbose", pkg).
command.New(sdkManagerPath, "--verbose", "--channel="+cfg.EmulatorChannel, pkg).
SetStdin(strings.NewReader(yes)), // hitting yes in case it waits for accepting license
},

Expand Down
17 changes: 9 additions & 8 deletions step.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
title: AVD Manager
summary: |-
Create an Android emulator with the AVD Manager Step.
Create and boot an Android emulator used for device testing
description: |-
Test your project in an Android emulator with the AVD Manager. Once some basic inputs are set, the Step checks the requirements, downloads and installs the packages before creating and starting the emulator.
Run instrumented and UI tests on a virtual Android device. Once some basic inputs are set, the Step checks the requirements, downloads the selected system image before creating and starting the emulator.

### Configuring the Step
1. Add the **AVD Manager** Step to your Workflow as one of the first Steps in your Workflow.
2. Set the **Device Profile** to create a new Android virtual device. To see the complete list of available profiles, use the `avdmanager list device` command.
2. Set the **Device Profile** to create a new Android virtual device. To see the complete list of available profiles, use the `avdmanager list device` command and use the `id` value for this input.
3. Set the **Android API Level**. The new virtual device will run with the specified Android version.
4. Select an **OS Tag** to have the required toolset on the new virtual device.

Some system images are pre-installed on the virtual machines. In this case the step won't have to spend time downloading the requested image. To check the list of pre-installed images for each stack, visit the [system reports](https://github.com/bitrise-io/bitrise.io/tree/master/system_reports)
ofalvai marked this conversation as resolved.
Show resolved Hide resolved

### Troubleshooting
The emulator needs some time to boot up. The earlier you place the Step in your Workflow, the more tasks, such as cloning or caching, you can complete in your Workflow before the emulator starts working.
We recommend that you also add **Wait for Android emulator** Step to your Workflow as it acts as a shield preventing the AVD Manager to kick in too early. Make sure you add the **Wait for Android emulator** Step BEFORE the Step with which you want to use the **AVD Manager**.
Expand All @@ -25,8 +27,6 @@ description: |-
website: https://github.com/bitrise-steplib/steps-avd-manager
source_code_url: https://github.com/bitrise-steplib/steps-avd-manager
support_url: https://github.com/bitrise-steplib/steps-avd-manager/issues
host_os_tags:
- osx-10.10

type_tags:
- utility
Expand All @@ -38,13 +38,12 @@ is_skippable: false
toolkit:
go:
package_name: github.com/bitrise-steplib/steps-avd-manager
run_if: ""

inputs:
- profile: pixel
opts:
title: Device Profile
summary: Set the device profile to create the new AVD. This profile contains all the parameters of the devices. To see the complete list of available profiles please use the `avdmanager list device` command.
description: Set the device profile to create the new AVD. This profile contains all the parameters of the devices. To see the complete list of available profiles please use the `avdmanager list device` command.
description: Set the device profile to create the new virtual device. This profile contains all the parameters of the devices. To see the complete list of available profiles use the `avdmanager list device` command locally and use the `id` value for this input.
is_required: true
- api_level: 26
opts:
Expand All @@ -62,6 +61,8 @@ inputs:
value_options:
- google_apis
- google_apis_playstore
- google_atd
- aosp_atd
- android-wear
- android-tv
- default
Expand Down