Repository navigation
Expand file tree
/
Copy pathstep.yml
More file actions
executable file
·230 lines (204 loc) · 10.3 KB
/
Copy pathstep.yml
File metadata and controls
executable file
·230 lines (204 loc) · 10.3 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
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).
By default, the Step waits for the emulator to boot up and disables system animations in order to make tests faster and more reliable. If you want to disable these, set the **Disable animations** input to `no`. In this case, make sure to add the [Wait for Android emulator Step](https://github.com/bitrise-steplib/steps-wait-for-android-emulator) to the right part of your workflow.
### 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: The profile contains parameters of the device, such as screen size and resolution.
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_ps16k
- google_apis_playstore
- google_apis_playstore_ps16k
- 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.
Note: when this input is `yes`, the step will pause and wait for the device to boot up.
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
summary: Allows installing a specific emulator version at runtime.
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"
- host_debug_tags: none
opts:
category: Debugging
title: Emulator debug tags
summary: Comma-separated list of emulator debug tags (e.g. `init,avd,kernel` or `all`). Passed to the emulator as `-debug [tags]`.
description: |-
Comma-separated list of emulator debug tags (e.g. `init,avd,kernel` or `all`). Passed to the emulator as `-debug [tags]`.
When set, the emulator host process stdout/stderr is saved to `$BITRISE_DEPLOY_DIR` and its path exported as `$BITRISE_EMULATOR_HOST_LOG`. Logs are preserved even if the device never becomes reachable via `adb`.
Set to `none` to disable. Run `emulator -help-debug-tags` locally to see the full list of available tags.
is_required: false
value_options:
- none
- "init,avd,kernel,snapshot"
- "all"
- device_logcat_tags: none
opts:
category: Debugging
title: Logcat filters
summary: Space- or comma-separated logcat filters in `componentName:logLevel` format, passed to the emulator as `-logcat [tags]`.
description: |-
Space- or comma-separated logcat filters in `componentName:logLevel` format, passed to the emulator as `-logcat [tags]`.
`componentName` is either `*` (wildcard) or a component name such as `ActivityManager` or `GSM`.
`logLevel` is one of: `v` (verbose), `d` (debug), `i` (informative), `w` (warning), `e` (error), `s` (silent).
Example: `*:s GSM:i` — suppresses all logs except GSM at informative level.
When set, the device-side logcat stream is captured via `-logcat-output` to `$BITRISE_DEPLOY_DIR` and its path exported as `$BITRISE_EMULATOR_DEVICE_LOGCAT_LOG`.
Set to `none` to disable. See `adb logcat --help` for more information.
is_required: false
value_options:
- none
- "*:v"
- "*:d"
- "*:i"
- "*:w"
- "*:e"
- "*:s"
outputs:
- BITRISE_EMULATOR_SERIAL:
opts:
title: Emulator serial
summary: Booted emulator serial
description: Booted emulator serial
- BITRISE_EMULATOR_HOST_LOG:
opts:
title: Emulator log file path
summary: Path to the emulator process stdout/stderr log file. Only set when `host_debug_tags` is non-empty.
description: Path to the emulator process stdout/stderr log file. Only set when `host_debug_tags` is non-empty.
- BITRISE_EMULATOR_DEVICE_LOGCAT_LOG:
opts:
title: Emulator logcat log file path
summary: Path to the device-side logcat log file captured via `-logcat-output`. Only set when `device_logcat_tags` is non-empty.
description: Path to the device-side logcat log file captured via `-logcat-output`. Only set when `device_logcat_tags` is non-empty.