Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Detox on a real Android device - supported? #968

Closed
EdwardDrapkin opened this issue Oct 3, 2018 · 3 comments
Closed

Running Detox on a real Android device - supported? #968

EdwardDrapkin opened this issue Oct 3, 2018 · 3 comments

Comments

@EdwardDrapkin
Copy link
Contributor

I'm trying to run my tests on a real device or in a Genymotion cloud AWS instance. They complete successfully on a local emulator.

I've tried with a local Android emulator as device type android.emulator and a local Genymotion emulator as android.attached; both work correctly. When I try to run android.attached with a real device ID, things start to go wrong. The application builds and installs successfully, and it even launches successfully as well. But then nothing ever happens until the Jest tests timeout with errors about device and element not being defined.

Looking at the log files, it seems like the test can't connect to the Detox server but I'm not sure if I'm reading things correctly.

  • Detox: 9.0.4
  • React Native: 0.56
  • Node: 10.5
  • Device: Google Pixel / ZTE Z983 / Genymotion AWS 8.0 image
  • Xcode: n/a
  • macOS: High Sierra

Here's my configuration...

        "android.wallet.device": {
                "binaryPath": "android/app/build/outputs/apk/flexwallet/release/app-flexwallet-release.apk",
                "build": "cd android && ./gradlew assembleFlexwalletRelease assembleAndroidTest -DtestBuildType=release && cd ..",
                "type": "android.attached",
                "name": "9802d885"
            },

...and I launch it like so....

detox test --configuration=android.wallet.device --runner-config=test/detox-jest.json --specs=e2e/ --artifacts-location=./.e2e/flexmobile --loglevel=trace --record-logs=all

... and I get these logs: detox_pid_87613.log and test.log

@EdwardDrapkin EdwardDrapkin changed the title Running Detox on a real device - supported? Running Detox on a real Android device - supported? Oct 3, 2018
@EdwardDrapkin
Copy link
Contributor Author

EdwardDrapkin commented Oct 3, 2018

I read through the source code and it looks like running detox run-server and adding:

"session": {
            "sessionId": "manualsession",
            "server": "ws://192.168.41.137:8099" #output from detox run-server
        },

to my Detox config that gets passed to init() was what I needed to do.

Is this documented somewhere I missed?

@frankgerhardt
Copy link

I'm interested in this as well. I'm surprised that this issue is new. For iOS #95 is the second oldest open issue.

@EdwardDrapkin
Copy link
Contributor Author

Upon further research, it seems that running adb reverse tcp:8099 tcp:8099 and running the detox server on 8099 every time is the best solution.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants