# Detox cannot interact with Android emulator

**URL:** <https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278>\
**Category:** Question & Answer\
**Created:** [March 4, 2019, 5:43am UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278 "2019-03-04T05:43:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ns\_bvs](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@ns\_bvs](https://discuss.bitrise.io/u/ns_bvs)\
**Post date:** [March 4, 2019, 5:43am UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/1 "2019-03-04T05:43:10Z")

</div>

Hey. I tried to run detox e2n tests on android emulator. All steps works fine, Android emulator booted, but seems like detox cannot interact with him and all test were failed by timeout.

here my .yml

```auto
    before_run: []
    after_run: []
    steps:
    - npm:
        inputs:
        - command: install -g detox-cli
        title: Install Detox CLI
    - npm:
        inputs:
        - command: install -g react-native-cli
        title: Install React Native CLI
    - script:
        inputs:
        - is_debug: 'yes'
        - content: |-
            #!/bin/bash

            detox build --configuration android.emu.release
        title: Detox - Build Release App (Android)
    - avd-manager@0.9.2: {}
    - wait-for-android-emulator@1.0.4:
        inputs:
        - boot_timeout: '800'
    - script:
        inputs:
        - is_debug: 'yes'
        - content: |-
            #!/bin/bash

            detox test --configuration android.emu.release --cleanup
        title: Detox - Run E2E Tests (android)

```

I got the following error:

```auto
 Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.

```

I run this on `Hybrid (Xamarin, Ionic, ...) on macOS, includes Visual Studio for Mac, Stable channel` and with x86 android emulator.

But I am sure that all of these works correctly.

---

<div class="post-metadata">

**Author:** ![fehersanyi-bitrise](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/fehersanyi-bitrise/32/1912_2.png) [@fehersanyi-bitrise](https://discuss.bitrise.io/u/fehersanyi-bitrise)\
**Post date:** [March 4, 2019, 10:30am UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/2 "2019-03-04T10:30:43Z")

</div>

Hello there!

Our guide on detox test just came out, could you check it out, maybe it can help you out in this case: [https://devcenter.bitrise.io/testing/running-detox-tests-on-bitrise/](https://devcenter.bitrise.io/testing/running-detox-tests-on-bitrise/)

---

<div class="post-metadata">

**Author:** ![ns\_bvs](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@ns\_bvs](https://discuss.bitrise.io/u/ns_bvs)\
**Post date:** [March 4, 2019, 12:00pm UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/3 "2019-03-04T12:00:45Z")

</div>

Thanks. I have already saw it. Unfortunately this guide describe only build for iOS. Build for iOS works fine, but I have a trouble with running detox on Android. Is there a guide how I can run detox tests for Android on bitrise?

---

<div class="post-metadata">

**Author:** ![fehersanyi-bitrise](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/fehersanyi-bitrise/32/1912_2.png) [@fehersanyi-bitrise](https://discuss.bitrise.io/u/fehersanyi-bitrise)\
**Post date:** [March 5, 2019, 10:17am UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/4 "2019-03-05T10:17:28Z")

</div>

Could you please send me the latest build’s url where you tried this? maybe I can get something from the logs 🙃

---

<div class="post-metadata">

**Author:** ![ns\_bvs](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@ns\_bvs](https://discuss.bitrise.io/u/ns_bvs)\
**Post date:** [March 5, 2019, 11:03am UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/5 "2019-03-05T11:03:01Z")

</div>

Here is my failed build [https://app.bitrise.io/build/705ad0a7cf10ebd9](https://app.bitrise.io/build/705ad0a7cf10ebd9)  
I am not sure that this url will work for you, because app is private

---

<div class="post-metadata">

**Author:** ![fehersanyi-bitrise](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/fehersanyi-bitrise/32/1912_2.png) [@fehersanyi-bitrise](https://discuss.bitrise.io/u/fehersanyi-bitrise)\
**Post date:** [March 5, 2019, 11:27am UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/6 "2019-03-05T11:27:51Z")

</div>

Hey,

Where do you set for the test to which emulator to install the app? 🤔  
and/or the artifact location could be wrong,  
also I’m not really sure, but don’t you need an apk to use with the emulator? 🤔

---

<div class="post-metadata">

**Author:** ![ns\_bvs](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@ns\_bvs](https://discuss.bitrise.io/u/ns_bvs)\
**Post date:** [March 5, 2019, 12:14pm UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/7 "2019-03-05T12:14:27Z")

</div>

I run detox tests in .yml by this line `detox test --configuration android.emu.release --cleanup` that use this config from my package.json

```auto
"android.emu.release": {
        "binaryPath": "android/app/build/outputs/apk/e2e/release/app-e2e-release.apk",
        "build": "cd android && ./gradlew assembleE2eRelease assembleAndroidTest -DtestBuildType=release && cd ..",
        "type": "android.emulator",
        "name": "emulator"
      }

```

---

<div class="post-metadata">

**Author:** ![fehersanyi-bitrise](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/fehersanyi-bitrise/32/1912_2.png) [@fehersanyi-bitrise](https://discuss.bitrise.io/u/fehersanyi-bitrise)\
**Post date:** [March 5, 2019, 1:41pm UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/8 "2019-03-05T13:41:45Z")

</div>

and I guess the `Detox - Build Release App` step is generating the apk file, I see it runs a gradle task but I can’t find the apk output of the step 😕  
also I have doubts about the emulator name, only because I can’t find it in the logs, only an ID that is “emulator” and a serial that is `emulator-5554`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [April 4, 2019, 1:41pm UTC](https://discuss.bitrise.io/t/detox-cannot-interact-with-android-emulator/8278/9 "2019-04-04T13:41:47Z")

</div>

Closed on April 4, 2019, 1:41pm UTC

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