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

Unable to run Detox Test apk #4032

Closed
1 of 2 tasks
Anantha-sb opened this issue Apr 28, 2023 · 2 comments
Closed
1 of 2 tasks

Unable to run Detox Test apk #4032

Anantha-sb opened this issue Apr 28, 2023 · 2 comments

Comments

@Anantha-sb
Copy link

What happened?

I have been trying to run detox on WSL 2 but no luck no matter how many solutions I try. I have done my complete setup (java, nodejs, android-studio, yarn, npm, everything needed) in WSL 2. From these, I am able to build both binaryPath and testBinaryPath.

When I try to connect ADB from WSL 2, and when I try the command yarn detox:e2e:android-debug, Detox fails to install / run the test apks.

These are the solutions I have tried:

Pre-req:

  1. Configure PORTS 5555, 5037, 5556 and allow inbound traffic in windows firewall
  2. UBSIPD

Solution 1 - Connect using the PORT 5555

Windows cmd: adb kill-server
Windows cmd: adb start-server
Windows cmd: adb tcpip 5555

WSL2: adb connect <phone_ip>:5555

Error - No Host to Route

Solution 2 - Connect by using the variable ADB_SERVER_SOCKET=tcp:<windows_host_IP>:5037

Windows cmd: adb -a -P 5037 nodaemon server start
Windows cmd: adb devices -> Device gets listed

WSL2: adb devices -> Device gets listed and I can run adb logcat and I can even install the react apk built at binaryPath but the apk generated at testBinaryPath does not get installed.

Error:

adb.exe I 04-28 18:34:17 24176 10752 transport.cpp:1727] fetching keys for transport 19287B2023
adb.exe I 04-28 18:34:17 24176 10752 auth.cpp:468] Calling send_auth_response
adb.exe I 04-28 18:34:17 24176 10752 auth.cpp:435] Calling send_auth_publickey
adb.exe I 04-28 18:34:20 24176 10752 adb.cpp:176] 19287B2023: offline
adb.exe E 04-28 18:37:03 24176 10752 services.cpp:83] failed to connect to socket 'tcp:33999': cannot connect to 127.0.0.1:33999: No connection could be made because the target machine actively refused it. (10061)
adb.exe E 04-28 18:37:08 24176 10752 services.cpp:83] failed to connect to socket 'tcp:33999': cannot connect to 127.0.0.1:33999: No connection could be made because the target machine actively refused it. (10061)
adb.exe E 04-28 18:37:13 24176 10752 services.cpp:83] failed to connect to socket 'tcp:33999': cannot connect to 127.0.0.1:33999: No connection could be made because the target machine actively refused it. (10061)
adb.exe E 04-28 18:37:18 24176 10752 services.cpp:83] failed to connect to socket 'tcp:33999': cannot connect to 127.0.0.1:33999: No connection could be made because the target machine actively refused it. (10061)
adb.exe E 04-28 18:37:23 24176 10752 services.cpp:83] failed to connect to socket 'tcp:33999': cannot connect to 127.0.0.1:33999: No connection could be made because the target machine actively refused it. (10061)
adb.exe E 04-28 18:37:28 24176 10752 services.cpp:83] failed to connect to socket 'tcp:33999': cannot connect to 127.0.0.1:33999: No connection could be made because the target machine actively refused it. (10061)
adb.exe E 04-28 18:37:33 24176 10752 services.cpp:83] failed to connect to socket 'tcp:33999': cannot connect to 127.0.0.1:33999: No connection could be made because the target machine actively refused it. (10061)

Solution 3 - Wi-Fi Debugging

Android: Enable Wi-Fi debugging

WSL2: adb connect <phone_ip>:5556 - This works flawlessly on a Mac but not in WSL2.

What was the expected behaviour?

I just want detox test apk generated at testBinaryPath to run.

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: The latest 20+
React Native version:
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version: v16.20.0
Device model: EDA51
Android version: Android 8.1.0
Test-runner (select one): jest / other : Cucumber

Detox logs

Detox logs
paste logs here!

adb_connection_refused
Adb

Device logs

Device logs
paste your device.log here!

More data, please!

No response

@stale
Copy link

stale bot commented Jun 10, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this repository, read this discussion.

@stale stale bot added the 🏚 stale label Jun 10, 2023
@stale
Copy link

stale bot commented Jun 17, 2023

The issue has been closed for inactivity.

@stale stale bot closed this as completed Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant