-
Notifications
You must be signed in to change notification settings - Fork 29
/
step.yml
executable file
·175 lines (156 loc) · 7.72 KB
/
step.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
title: AVD Manager
summary: |-
Create and boot an Android emulator used for device testing
description: |-
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.
**Warning:** Android emulators can't run on Apple Silicon build machines. Until nested virtualization becomes supported, you should run emulator tests on Linux machines.
### 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 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://stacks.bitrise.io).
### 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**.
### Useful links
- [Getting started with Android apps](https://devcenter.bitrise.io/getting-started/getting-started-with-android-apps/)
- [Device testing for Android](https://devcenter.bitrise.io/testing/device-testing-for-android/)
- [About Test Reports](https://devcenter.bitrise.io/testing/test-reports/)
### Related Steps
- [Wait for Android emulator](https://www.bitrise.io/integrations/steps/wait-for-android-emulator)
- [Android Build for UI testing](https://www.bitrise.io/integrations/steps/android-build-for-ui-testing)
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
type_tags:
- test
is_always_run: false
is_skippable: false
toolkit:
go:
package_name: github.com/bitrise-steplib/steps-avd-manager
inputs:
- profile: pixel
opts:
title: Device Profile ID
summary: Device profile to use when creating the virtual device.
description: |
The profile contains parameters of the device, such as screen size and resolution.
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:
title: Android API Level
summary: The device will run with the specified system image version.
description: The device will run with the specified system image version.
is_required: true
- tag: google_apis
opts:
title: OS Tag
summary: Select OS tag to have the required toolset on the device.
description: Select OS tag to have the required toolset on the device.
is_expand: true
is_required: true
value_options:
- google_apis
- google_apis_playstore
- google_atd
- aosp_atd
- android-wear
- android-tv
- default
- abi: x86
opts:
category: Advanced
title: ABI
summary: Select which ABI to use running the emulator. Availability depends on API level. Please use `sdkmanager --list` command to see the available ABIs.
description: Select which ABI to use running the emulator. Availability depends on API level. Please use `sdkmanager --list` command to see the available ABIs.
is_expand: true
is_required: true
value_options:
- x86
- x86_64
- armeabi-v7a
- arm64-v8a
- mips
- disable_animations: "yes"
opts:
category: Advanced
title: Disable animations
summary: Disable animations on the emulator in order to make tests faster and more stable.
description: |-
Disable animations on the emulator in order to make tests faster and more stable.
Animations can be enabled/disabled from the test code too, so if your tests do need animations, set this step input to `no` and control the settings yourself.
is_required: true
value_options:
- "yes"
- "no"
- emulator_id: emulator
opts:
category: Advanced
title: ID
summary: Set the device's ID. (This will be the name under $HOME/.android/avd/)
description: Set the device's ID. (This will be the name under $HOME/.android/avd/)
is_required: true
- create_command_flags: --sdcard 2048M
opts:
category: Advanced
title: Create AVD command flags
summary: Flags used when running the command to create the emulator.
description: Flags used when running the command to create the emulator.
is_required: false
- start_command_flags: -camera-back none -camera-front none
opts:
category: Advanced
title: Start AVD command flags
summary: Flags used when running the command to start the emulator.
description: Flags used when running the command to start the emulator.
is_required: false
- emulator_build_number: preinstalled
opts:
category: Emulator
title: Emulator build number
description: |-
Allows installing a specific emulator version at runtime. The default value (`preinstalled`) will use the emulator version preinstalled on the Stack, which is updated regularly to the latest stable version.
See available build numbers [here](https://developer.android.com/studio/emulator_archive). You need the last segment of the download URL, for example, build number `12658423` from `emulator-linux_x64-12658423.zip`. Note: this input expects the **build number**, not the **version number**.
When this input set to a specific build number, the `emulator_channel` input should be set to `no update`.
- emulator_channel: no update
opts:
category: Emulator
title: Emulator channel
summary: Select which channel to use with `sdkmanager` to fetch *emulator* package. Available options are no update, or channels 0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).
description: |-
Select which channel to use with `sdkmanager` to fetch *emulator* package. Available options are no update, or channels 0 (Stable), 1 (Beta), 2 (Dev), and 3 (Canary).
- `no update`: The *emulator* preinstalled on the Stack will be used. *system-image* will be updated to the latest Stable version.
To update *emulator* and *system image* to the latest available in a given channel:
- `0`: Stable channel
- `1`: Beta channel
- `2`: Dev channel
- `3`: Canary channel
When this input set to a specific channel, the `emulator_build_number` input should be set to `preinstalled`.
is_expand: true
is_required: true
value_options:
- no update
- "0"
- "1"
- "2"
- "3"
- headless_mode: "yes"
opts:
category: Emulator
title: Run the emulator in headless mode
summary: In headless mode the emulator is not launched in the foreground.
description: |-
In headless mode the emulator is not launched in the foreground.
If this input is set, the emulator will not be visible but tests (even the screenshots) will run just like if the emulator ran in the foreground.
is_required: true
value_options:
- "yes"
- "no"
outputs:
- BITRISE_EMULATOR_SERIAL:
opts:
title: Emulator serial
description: Booted emulator serial