AVD Manager and Wait for Android Emulator

I am attempting to use the AVD Manager and Wait for Android emulator steps in order to run connectedAndroidTest via the Gradle Runner step, but keep getting weird errors on the Wait for Android Emulator step.

When the AVD Manager step is at the latest version (0.9.2), the AVD Manager step says it runs fine and started the emulator, but on the Wait for Android emulator step it fails:

INFO[17:58:01] Start installing (golang) with apt-get       
+------------------------------------------------------------------------------+

| (6) wait-for-android-emulator@1.0.4                                          |
+------------------------------------------------------------------------------+
| id: wait-for-android-emulator                                                |
| version: 1.0.4                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2019-01-15T17:58:01Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[17:58:02]  * [OK] Step dependency (go) installed, available. 
Configs:
- emulatorSerial: emulator-5554
- bootTimeout: 300
- AndroidHome: /opt/android-sdk-linux
Waiting for emulator boot
> Checking if device booted...
Running command timed out, retry...
> Checking if device booted...
Failed to check emulator boot status, error: * daemon not running; starting now at tcp:5037
* daemon started successfully
error: device offline - exit status 1
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | wait-for-android-emulator@1.0.4 (exit code: 1)                | 38 sec   |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...com/bitrise-steplib/steps-wait-for-android-emulator/issues |
| Source: https://github.com/bitrise-steplib/steps-wait-for-android-emulator   |
+---+---------------------------------------------------------------+----------+

When this occurs, the build never finishes and I have to actually abort the build instead of it just failing… I saw in this forum a suggestion to change the AVD Manager back to version 0.9.1, so I did, but I get a different error:

+------------------------------------------------------------------------------+

| (7) wait-for-android-emulator@1.0.4                                          |
+------------------------------------------------------------------------------+
| id: wait-for-android-emulator                                                |
| version: 1.0.4                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2019-01-15T17:47:43Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[17:47:43] Start installing (golang) with apt-get       
INFO[17:47:43]  * [OK] Step dependency (go) installed, available. 
Configs:
- emulatorSerial: emulator-5554
- bootTimeout: 300
- AndroidHome: /opt/android-sdk-linux
Waiting for emulator boot
> Checking if device booted...
Failed to check emulator boot status, error: error: device 'emulator-5554' not found - exit status 1
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | wait-for-android-emulator@1.0.4 (exit code: 1)                | 7.93 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...com/bitrise-steplib/steps-wait-for-android-emulator/issues |
| Source: https://github.com/bitrise-steplib/steps-wait-for-android-emulator   |
+---+---------------------------------------------------------------+----------+

All I want is to start the emulator and then run a ./gradlew connectedAndroidTest command to run the tests on the emulator, but the steps to actually launch an emulator don’t work as expected… Am I missing something in the set up, or is this just a broken step and is there another way to start an emulator? Why would these steps be here if they don’t even work?

For reference, here is the steps I am using to attempt this:

Hi @Devetry!

Sorry to hear about these inconveniences. Could you perhaps also include a build URL for us?

@bitce I actually ended up finding this suggestion that recommends using a different method than AVD Manager. I ended up using this link. Thanks though!

1 Like

Hi @bitce i’m having the same problem, here is the URL build: https://app.bitrise.io/build/b4790173a0a558db
Can you help me please?

Hy there!

can you check this method please?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.