expo / detox-expo-helpers

44 stars 34 forks source link

Add android example / support #2

Open xcarpentier opened 7 years ago

xcarpentier commented 7 years ago

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

brentvatne commented 7 years ago

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

conblem commented 7 years ago

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 commented 6 years ago

@brentvatne

brentvatne commented 6 years ago

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

conblem commented 6 years ago

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

ararog commented 6 years ago

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.

conblem commented 6 years ago

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

brentvatne commented 6 years ago

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

esamelson commented 6 years ago

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 👍

nykolaslima commented 6 years ago

@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.

esamelson commented 6 years ago

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.

maitriyogin commented 5 years ago

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.

aarshaw commented 5 years ago

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

maitriyogin commented 5 years ago

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

maitriyogin commented 5 years ago

any news on this expo masters? /Stephen

CorinneKelly commented 4 years ago

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

esamelson commented 4 years ago

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!

brentvatne commented 4 years ago

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

AizenSousuke commented 1 year ago

Anyone got a solution to this issue on Windows?