detox-expo-helpers icon indicating copy to clipboard operation
detox-expo-helpers copied to clipboard

Add android example / support

Open xcarpentier opened this issue 7 years ago • 19 comments

@brentvatne Add android example / support, please 🐱 ...

xcarpentier avatar Sep 13 '17 09:09 xcarpentier

can you try to figure it out? on vacation for 2 weeks. let me know :)

brentvatne avatar Sep 14 '17 16:09 brentvatne

I have been trying to figure this out, but i'm currently stuck on this error. Repo

  console.error node_modules\react-native\Libraries\Core\ExceptionsManager.js:73
    Unhandled error

  console.error node_modules\react-native\Libraries\Core\ExceptionsManager.js:73
    Error: spawn adb ENOENT
        at _errnoException (util.js:1021:11)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
        at onErrorNT (internal/child_process.js:374:16)
        at _combinedTickCallback (internal/process/next_tick.js:138:11)
        at process._tickCallback (internal/process/next_tick.js:180:9)

To make it, to this error the Expo APK needs to be placed into the root of the project, with the original name and also as a duplicate, with the name Exponent-2.0.0-androidTest.apk.

The APK for Expo can be found on their website. Exponent-2.0.0.apk

Some help would be appreciated :).

conblem avatar Oct 24 '17 14:10 conblem

@brentvatne

conblem avatar Nov 09 '17 18:11 conblem

@conblem - not familiar with that error, looks like adb isn't in your PATH

brentvatne avatar Nov 15 '17 00:11 brentvatne

@brentvatne Yeah thats what i thought too but its definitely in my path.

conblem avatar Nov 16 '17 20:11 conblem

At first I had only ANDROID_HOME set, but once I've added $ANDROID_HOME/platform-tools to the path I could get rid of this message about adb.

ararog avatar Jan 16 '18 01:01 ararog

@ararog will try this out, thanks for the hint 👍

conblem avatar Jan 16 '18 06:01 conblem

we're investigating this currently, I think it's not so straightforward, cc @esamelson

brentvatne avatar Feb 07 '18 00:02 brentvatne

yeah the plan is to PR a few things to detox to make it work better with expo. Currently detox makes a number of assumptions about RN apps that expo doesn't follow, which makes it difficult to integrate as it is. Hopefully we'll get to this soon, so stay tuned 👍

esamelson avatar Feb 07 '18 18:02 esamelson

@esamelson do you have any update on this? If you have any guide about how to help implementing this, we're starting a expo/react native application but we're worried about how to run e2e tests and Detox looks like a better solution but not supported by expo/android apps.

nykolaslima avatar Jul 17 '18 18:07 nykolaslima

Hi @nykolaslima - no update unfortunately 😞 We have simply not had the time and ability to prioritize this. We'd like to pick this up at some point but it's not on the roadmap at the moment. You'll need to either dig into this yourself or find a different solution for Android for now.

esamelson avatar Jul 19 '18 01:07 esamelson

Hi, I'm trying to get detox running on android with expo sdk 32. My basic config is such

"android.emu.debug": {
        "binaryPath": "bin/Exponent.apk",
        "type": "android.emulator",
        "name": "Nexus_5X_API_27"
      }

Then to run I :

download latest Exponent.apk from expo using a variant of brents script

#!/bin/bash -e

# query expo.io to find most recent ipaUrl
IPA_URL=`curl https://expo.io/--/api/v2/versions |  python -c 'import sys, json; print json.load(sys.stdin)["androidUrl"]'`

# download tar.gz
TMP_PATH=bin/Exponent.apk
wget -O $TMP_PATH $IPA_URL

expo start detox test -c android.emu.debug

Emulator starts up but then nothing... The setup is the same as with-detox-test and the getting started. All works amazingly on iOS ...

So, just wondering if I'm being totally nieve or if anyone else out there has managed to get expo working with detox on android ...? or even where I could start to help out?

Many thanks, Stephen.

maitriyogin avatar Apr 29 '19 10:04 maitriyogin

@maitriyogin were you able to get anything working on Android?

aarshaw avatar Jun 13 '19 16:06 aarshaw

Nope, looks like the expo team are working on it or at least aware of it..

maitriyogin avatar Jun 13 '19 16:06 maitriyogin

any news on this expo masters? /Stephen

maitriyogin avatar Aug 23 '19 11:08 maitriyogin

@esamelson @brentvatne @conblem (you guys seem to be working on this). Any updates on getting e2e testing on android with expo?

CorinneKelly avatar Jan 09 '20 05:01 CorinneKelly

Hey there, this is not something we're actively working on at the moment. Apologies if any previous stale activity in this issue was misleading. You're welcome to dig into this yourself, though, and we're definitely open to accepting a high quality PR or set of PRs adding this functionality!

esamelson avatar Jan 09 '20 19:01 esamelson

indeed, i suggest using the bare workflow if you need to run tests with detox.

brentvatne avatar Jan 09 '20 19:01 brentvatne

Anyone got a solution to this issue on Windows?

AizenSousuke avatar Mar 21 '23 11:03 AizenSousuke