wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.2k stars 1.92k forks source link

Can not run test on Android ( React Native ) #4091

Closed ghost closed 1 year ago

ghost commented 1 year ago

What happened?

I'm using Mac with Apple Chip M2 and I can not run test with android emulator , but at simulator iOS its work well Hope you guy can help me , really appreciate and love this project

Commands that I was run lastest:

detox build --configuration android.emu.debug

detox test --configuration android.emu.debug

What was the expected behaviour?

Can run test on Android

Was it tested on latest Detox?

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: ^20.9.1 React Native version: 0.70.6 Has Fabric (React Native's new rendering system) enabled: no Node version: 16 Device model: Emulator Pixel 3a Android version: 33 Test-runner (select one): jest

Detox logs

Detox logs ``` bundleId":"com.company.appname.uat"}) 11:59:41.085 detox[78987] E artifacts-manager onTerminateApp 11:59:41.085 detox[78987] E device terminateApp 11:59:41.085 detox[78987] E device selectApp 11:59:41.086 detox[78987] B device installApp args: () 11:59:41.086 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/build-tools/33.0.2/aapt" dump xmlstrings "/Users/xxxxx/projects/appname-mobile/android/app/build/outputs/apk/debug/app-debug.apk" AndroidManifest.xml 11:59:41.124 detox[78987] i child-process:EXEC_SUCCESS String pool of 252 unique UTF-16 non-sorted strings, 252 entries and 0 styles using 19424 bytes: String #0: theme String #1: label String #2: icon String #3: name String #4: permission String #5: protectionLevel String #6: enabled String #7: debuggable String #8: exported String #9: taskAffinity String #10: excludeFromRecents String #11: authorities String #12: initOrder String #13: grantUriPermissions String #14: priority String #15: launchMode String #16: screenOrientation String #17: configChanges String #18: value String #19: resource String #20: scheme String #21: host String #22: minSdkVersion String #23: versionCode String #24: versionName String #25: windowSoftInputMode String #26: noHistory String #27: isScrollContainer String #28: targetSdkVersion String #29: allowBackup String #30: required String #31: largeHeap String #32: stopWithTask String #33: supportsRtl String #34: extractNativeLibs String #35: fullBackupContent String #36: usesCleartextTraffic String #37: autoVerify String #38: directBootAware String #39: networkSecurityConfig String #40: roundIcon String #41: visibleToInstantApps String #42: compileSdkVersion String #43: compileSdkVersionCodename String #44: appComponentFactory String #45: requestLegacyExternalStorage String #46: String #47: 1.10.0 String #48: 13 String #49: GlideModule String #50: action String #51: activity String #52: android String #53: android.hardware.camera String #54: android.hardware.camera.autofocus String #55: android.hardware.camera.front String #56: android.hardware.camera.front.autofocus String #57: android.hardware.camera.level.full String #58: android.hardware.camera2.autofocus String #59: android.hardware.camera2.full String #60: android.hardware.sensor.gyroscope String #61: android.hardware.sensor.proximity String #62: android.intent.action.ACTION_POWER_CONNECTED String #63: android.intent.action.ACTION_POWER_DISCONNECTED String #64: android.intent.action.BATTERY_LOW String #65: android.intent.action.BATTERY_OKAY String #66: android.intent.action.BOOT_COMPLETED String #67: android.intent.action.DEVICE_STORAGE_LOW String #68: android.intent.action.DEVICE_STORAGE_OK String #69: android.intent.action.MAIN String #70: android.intent.action.MY_PACKAGE_REPLACED String #71: android.intent.action.QUICKBOOT_POWERON String #72: android.intent.action.TIMEZONE_CHANGED String #73: android.intent.action.TIME_SET String #74: android.intent.action.VIEW String #75: android.intent.category.BROWSABLE String #76: android.intent.category.DEFAULT String #77: android.intent.category.LAUNCHER String #78: android.net.conn.CONNECTIVITY_CHANGE String #79: android.permission.ACCESS_COARSE_LOCATION String #80: android.permission.ACCESS_NETWORK_STATE String #81: android.permission.ACCESS_WIFI_STATE String #82: android.permission.BIND_JOB_SERVICE String #83: android.permission.CAMERA String #84: android.permission.DUMP String #85: android.permission.FOREGROUND_SERVICE String #86: android.permission.INTERNET String #87: android.permission.POST_NOTIFICATIONS String #88: android.permission.READ_APP_BADGE String #89: android.permission.READ_EXTERNAL_STORAGE String #90: android.permission.RECEIVE_BOOT_COMPLETED String #91: android.permission.SYSTEM_ALERT_WINDOW String #92: android.permission.USE_BIOMETRIC String #93: android.permission.USE_FINGERPRINT String #94: android.permission.VIBRATE String #95: android.permission.WAKE_LOCK String #96: android.permission.WRITE_EXTERNAL_STORAGE String #97: android.support.FILE_PROVIDER_PATHS String #98: androidx.core.app.CoreComponentFactory String #99: androidx.emoji2.text.EmojiCompatInitializer String #100: androidx.lifecycle.ProcessLifecycleInitializer String #101: androidx.room.MultiInstanceInvalidationService String #102: androidx.startup String #103: androidx.startup.InitializationProvider String #104: androidx.work.WorkManagerInitializer String #105: androidx.work.diagnostics.REQUEST_DIAGNOSTICS String #106: androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryChargingProxy String #107: androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryNotLowProxy String #108: androidx.work.impl.background.systemalarm.ConstraintProxy$NetworkStateProxy String #109: androidx.work.impl.background.systemalarm.ConstraintProxy$StorageNotLowProxy String #110: androidx.work.impl.background.systemalarm.ConstraintProxyUpdateReceiver String #111: androidx.work.impl.background.systemalarm.RescheduleReceiver String #112: androidx.work.impl.background.systemalarm.SystemAlarmService String #113: androidx.work.impl.background.systemalarm.UpdateProxies String #114: androidx.work.impl.background.systemjob.SystemJobService String #115: androidx.work.impl.diagnostics.DiagnosticsReceiver String #116: androidx.work.impl.foreground.SystemForegroundService String #117: androidx.work.impl.utils.ForceStopRunnable$BroadcastReceiver String #118: app_data_collection_default_enabled String #119: application String #120: backend:com.google.android.datatransport.cct.CctBackendFactory String #121: category String #122: cct String #123: cct.com.company.appname.uat String #124: cl.json.RNShareFileProvider String #125: com.anddoes.launcher.permission.UPDATE_COUNT String #126: com.appsflyer.referrer.INSTALL_PROVIDER String #127: com.bumptech.glide.integration.okhttp3.OkHttpGlideModule String #128: com.company.appname.uat String #129: com.company.appname.uat.FacebookInitProvider String #130: com.company.appname.uat.MainActivity String #131: com.company.appname.uat.MainApplication String #132: com.company.appname.uat.SentryInitProvider String #133: com.company.appname.uat.SentryPerformanceProvider String #134: com.company.appname.uat.androidx-startup String #135: com.company.appname.uat.fileprovider String #136: com.company.appname.uat.firebaseinitprovider String #137: com.company.appname.uat.imagepickerprovider String #138: com.company.appname.uat.permission.C2D_MESSAGE String #139: com.company.appname.uat.reactnativefirebaseappinitprovider String #140: com.company.appname.uat.rnshare.fileprovider String #141: com.example.services String #142: com.example.store String #143: com.facebook.AuthenticationTokenManager$CurrentAuthenticationTokenChangedBroadcastReceiver String #144: com.facebook.CurrentAccessTokenExpirationBroadcastReceiver String #145: com.facebook.CustomTabActivity String #146: com.facebook.CustomTabMainActivity String #147: com.facebook.FacebookActivity String #148: com.facebook.internal.FacebookInitProvider String #149: com.facebook.katana String #150: com.facebook.react.devsupport.DevSettingsActivity String #151: com.facebook.sdk.ACTION_CURRENT_ACCESS_TOKEN_CHANGED String #152: com.facebook.sdk.ACTION_CURRENT_AUTHENTICATION_TOKEN_CHANGED String #153: com.facebook.sdk.ApplicationId String #154: com.facebook.sdk.ClientToken String #155: com.facebook.soloader.enabled String #156: com.google.android.c2dm.intent.RECEIVE String #157: com.google.android.c2dm.permission.RECEIVE String #158: com.google.android.c2dm.permission.SEND String #159: com.google.android.datatransport.runtime.backends.TransportBackendDiscovery String #160: com.google.android.datatransport.runtime.scheduling.jobscheduling.AlarmManagerSchedulerBroadcastReceiver String #161: com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService String #162: com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE String #163: com.google.android.gms.auth.api.signin.RevocationBoundService String #164: com.google.android.gms.auth.api.signin.internal.SignInHubActivity String #165: com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION String #166: com.google.android.gms.common.api.GoogleApiActivity String #167: com.google.android.gms.measurement.AppMeasurementJobService String #168: com.google.android.gms.measurement.AppMeasurementReceiver String #169: com.google.android.gms.measurement.AppMeasurementService String #170: com.google.android.gms.permission.AD_ID String #171: com.google.android.gms.version String #172: com.google.firebase.MESSAGING_EVENT String #173: com.google.firebase.components.ComponentDiscoveryService String #174: com.google.firebase.components.ComponentRegistrar String #175: com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar String #176: com.google.firebase.components:com.google.firebase.datatransport.TransportRegistrar String #177: com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar String #178: com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar String #179: com.google.firebase.components:io.invertase.firebase.app.ReactNativeFirebaseAppRegistrar String #180: com.google.firebase.iid.FirebaseInstanceIdReceiver String #181: com.google.firebase.messaging.FirebaseMessagingService String #182: com.google.firebase.messaging.default_notification_channel_id String #183: com.google.firebase.messaging.default_notification_color String #184: com.google.firebase.provider.FirebaseInitProvider String #185: com.htc.launcher.permission.READ_SETTINGS String #186: com.htc.launcher.permission.UPDATE_SHORTCUT String #187: com.huawei.android.launcher.permission.CHANGE_BADGE String #188: com.huawei.android.launcher.permission.READ_SETTINGS String #189: com.huawei.android.launcher.permission.WRITE_SETTINGS String #190: com.huawei.push.action.MESSAGING_EVENT String #191: com.imagepicker.ImagePickerProvider String #192: com.majeur.launcher.permission.UPDATE_BADGE String #193: com.onesignal.BootUpReceiver String #194: com.onesignal.FCMBroadcastReceiver String #195: com.onesignal.FCMIntentJobService String #196: com.onesignal.FCMIntentService String #197: com.onesignal.HmsMessageServiceOneSignal String #198: com.onesignal.NotificationDismissReceiver String #199: com.onesignal.NotificationOpenedActivityHMS String #200: com.onesignal.NotificationOpenedReceiver String #201: com.onesignal.NotificationOpenedReceiverAndroid22AndOlder String #202: com.onesignal.PermissionsActivity String #203: com.onesignal.SyncJobService String #204: com.onesignal.SyncService String #205: com.onesignal.UpgradeReceiver String #206: com.oppo.launcher.permission.READ_SETTINGS String #207: com.oppo.launcher.permission.WRITE_SETTINGS String #208: com.reactnativecommunity.webview.RNCWebViewFileProvider String #209: com.sec.android.provider.badge.permission.READ String #210: com.sec.android.provider.badge.permission.WRITE String #211: com.sonyericsson.home.permission.BROADCAST_BADGE String #212: com.sonymobile.home.permission.PROVIDER_INSERT_BADGE String #213: com.testfairy.activities.ProvideFeedbackActivity String #214: com.vnptit.idg.sdk.activity.VnptFrontActivity String #215: com.vnptit.idg.sdk.activity.VnptIdentityActivity String #216: com.vnptit.idg.sdk.activity.VnptOcrActivity String #217: com.vnptit.idg.sdk.activity.VnptPortraitActivity String #218: com.vnptit.idg.sdk.activity.VnptRearActivity String #219: data String #220: fbconnect String #221: filter_react_native String #222: firebase_messaging_auto_init_enabled String #223: http String #224: http://schemas.android.com/apk/res/android String #225: https String #226: intent String #227: intent-filter String #228: io.invertase.firebase.app.ReactNativeFirebaseAppInitProvider String #229: io.invertase.firebase.messaging.ReactNativeFirebaseMessagingHeadlessService String #230: io.invertase.firebase.messaging.ReactNativeFirebaseMessagingReceiver String #231: io.invertase.firebase.messaging.ReactNativeFirebaseMessagingService String #232: io.sentry.android.core.SentryInitProvider String #233: io.sentry.android.core.SentryPerformanceProvider String #234: io.sentry.auto-init String #235: manifest String #236: me.everything.badger.permission.BADGE_COUNT_READ String #237: me.everything.badger.permission.BADGE_COUNT_WRITE String #238: meta-data String #239: appname.io String #240: appname.onelink.me String #241: package String #242: permission String #243: platformBuildVersionCode String #244: platformBuildVersionName String #245: provider String #246: queries String #247: receiver String #248: service String #249: uses-feature String #250: uses-permission String #251: uses-sdk 11:59:41.127 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/build-tools/33.0.2/aapt" dump xmlstrings "/Users/xxxxx/projects/appname-mobile/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk" AndroidManifest.xml 11:59:41.160 detox[78987] i child-process:EXEC_SUCCESS String pool of 43 unique UTF-16 non-sorted strings, 43 entries and 0 styles using 2156 bytes: String #0: theme String #1: label String #2: name String #3: debuggable String #4: exported String #5: priority String #6: targetPackage String #7: handleProfiling String #8: functionalTest String #9: minSdkVersion String #10: targetSdkVersion String #11: extractNativeLibs String #12: compileSdkVersion String #13: compileSdkVersionCodename String #14: 13 String #15: Tests for com.company.appname.uat String #16: activity String #17: android String #18: android.intent.category.LAUNCHER String #19: android.permission.REORDER_TASKS String #20: android.test.runner String #21: androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity String #22: androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity String #23: androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity String #24: androidx.test.orchestrator String #25: androidx.test.runner.AndroidJUnitRunner String #26: androidx.test.services String #27: application String #28: category String #29: com.company.appname.uat String #30: com.company.appname.uat.test String #31: com.google.android.apps.common.testing.services String #32: http://schemas.android.com/apk/res/android String #33: instrumentation String #34: intent-filter String #35: manifest String #36: package String #37: platformBuildVersionCode String #38: platformBuildVersionName String #39: queries String #40: uses-library String #41: uses-permission String #42: uses-sdk 11:59:41.160 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "rm -fr /data/local/tmp/detox" 11:59:41.719 detox[78987] i child-process:EXEC_SUCCESS 11:59:41.719 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "mkdir -p /data/local/tmp/detox" 11:59:41.835 detox[78987] i child-process:EXEC_SUCCESS 11:59:41.836 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 push "/Users/xxxxx/projects/appname-mobile/android/app/build/outputs/apk/debug/app-debug.apk" "/data/local/tmp/detox/Application.apk" 11:59:49.710 detox[78987] i child-process:EXEC_SUCCESS /Users/xxxxx/projects/appname-mobile/android/app/build/outputs/apk/debug/app-debug.apk: 1 file pushed, 0 skipped. 38.5 MB/s (250480002 bytes in 6.210s) 11:59:49.719 detox[78987] i child-process:SPAWN_CMD /Users/xxxxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk 12:00:00.706 detox[78987] i child-process:SPAWN_STDOUT Success 12:00:00.722 detox[78987] i child-process:SPAWN_END /Users/xxxxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk exited with code #0 12:00:00.723 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 push "/Users/xxxxx/projects/appname-mobile/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk" "/data/local/tmp/detox/Test.apk" 12:00:00.954 detox[78987] i child-process:EXEC_SUCCESS /Users/xxxxx/projects/appname-mobile/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk: 1 file pushed, 0 skipped. 34.1 MB/s (3746120 bytes in 0.105s) 12:00:00.957 detox[78987] i child-process:SPAWN_CMD /Users/xxxxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Test.apk 12:00:02.654 detox[78987] i child-process:SPAWN_STDOUT Success 12:00:02.662 detox[78987] i child-process:SPAWN_END /Users/xxxxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Test.apk exited with code #0 12:00:02.665 detox[78987] B device reverseTcpPort args: (8081) 12:00:02.666 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:8081 tcp:8081 12:00:02.718 detox[78987] i child-process:EXEC_SUCCESS 12:00:02.719 detox[78987] E device reverseTcpPort 12:00:02.719 detox[78987] E device installApp 12:00:02.719 detox[78987] B device selectApp args: ("default") 12:00:02.720 detox[78987] B device terminateApp args: () 12:00:02.720 detox[78987] B artifacts-manager onBeforeTerminateApp args: ({"deviceId":"emulator-5554","bundleId":"com.company.appname.uat"}) 12:00:02.720 detox[78987] E artifacts-manager onBeforeTerminateApp 12:00:02.720 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop com.company.appname.uat" 12:00:03.152 detox[78987] i child-process:EXEC_SUCCESS 12:00:03.154 detox[78987] B artifacts-manager onTerminateApp args: ({"deviceId":"emulator-5554","bundleId":"com.company.appname.uat"}) 12:00:03.154 detox[78987] E artifacts-manager onTerminateApp 12:00:03.154 detox[78987] E device terminateApp 12:00:03.155 detox[78987] E device selectApp 12:00:03.156 detox[78987] E lifecycle set up environment 12:00:03.559 detox[78987] i lifecycle starter.test.js is assigned to emulator-5554 (Pixel_3a) 12:00:03.559 detox[78987] B lifecycle run the tests 12:00:03.559 detox[78987] B artifacts-manager onRunDescribeStart args: ({"name":"ROOT_DESCRIBE_BLOCK"}) 12:00:03.560 detox[78987] E artifacts-manager onRunDescribeStart 12:00:03.560 detox[78987] B lifecycle Sign In Flow 12:00:03.561 detox[78987] B artifacts-manager onRunDescribeStart args: ({"name":"Sign In Flow"}) 12:00:03.561 detox[78987] E artifacts-manager onRunDescribeStart 12:00:03.562 detox[78987] B lifecycle beforeAll 12:00:03.564 detox[78987] B device launchApp args: () 12:00:03.565 detox[78987] B device terminateApp args: ("com.company.appname.uat") 12:00:03.565 detox[78987] B artifacts-manager onBeforeTerminateApp args: ({"deviceId":"emulator-5554","bundleId":"com.company.appname.uat"}) 12:00:03.565 detox[78987] E artifacts-manager onBeforeTerminateApp 12:00:03.565 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop com.company.appname.uat" 12:00:03.756 detox[78987] i child-process:EXEC_SUCCESS 12:00:03.757 detox[78987] B artifacts-manager onTerminateApp args: ({"deviceId":"emulator-5554","bundleId":"com.company.appname.uat"}) 12:00:03.757 detox[78987] E artifacts-manager onTerminateApp 12:00:03.757 detox[78987] E device terminateApp 12:00:03.758 detox[78987] B artifacts-manager onBeforeLaunchApp args: ({"deviceId":"emulator-5554","bundleId":"com.company.appname.uat","launchArgs":{"detoxServer":"ws://localhost:65408","detoxSessionId":"677d2c73-1c1e-7d47-a3aa-6dda9ac1c0b5"}}) 12:00:03.758 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "date +\"%m-%d %T.000\"" 12:00:03.860 detox[78987] i child-process:EXEC_SUCCESS 05-27 12:00:03.000 12:00:03.861 detox[78987] E artifacts-manager onBeforeLaunchApp 12:00:03.861 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:65408 tcp:65408 12:00:03.902 detox[78987] i child-process:EXEC_SUCCESS 65408 12:00:03.903 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list instrumentation" 12:00:04.018 detox[78987] i child-process:EXEC_SUCCESS instrumentation:com.company.appname.uat.test/androidx.test.runner.AndroidJUnitRunner (target=com.company.appname.uat) 12:00:04.020 detox[78987] i child-process:SPAWN_CMD /Users/xxxxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:65408 -e detoxSessionId 677d2c73-1c1e-7d47-a3aa-6dda9ac1c0b5 -e debug false com.company.appname.uat.test/androidx.test.runner.AndroidJUnitRunner 12:00:04.528 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.company\.appname\.uat$\"" 12:00:06.167 detox[78987] i child-process:EXEC_FAIL ""/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.company\.appname\.uat$\""" failed with error = ChildProcessError: Command failed: "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.company\.appname\.uat$\"" `"/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.company\.appname\.uat$\""` (exited with error code 1) (code=1), stdout and stderr: 12:00:06.167 detox[78987] i child-process:EXEC_FAIL 12:00:06.168 detox[78987] i child-process:EXEC_FAIL 12:00:06.670 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"com\.company\.appname\.uat$\"" 12:00:07.014 detox[78987] i child-process:EXEC_SUCCESS u0_a202 18779 1554 15328972 113332 0 0 R com.company.appname.uat 12:00:07.015 detox[78987] B artifacts-manager onLaunchApp args: ({"deviceId":"emulator-5554","bundleId":"com.company.appname.uat","launchArgs":{"detoxServer":"ws://localhost:65408","detoxSessionId":"677d2c73-1c1e-7d47-a3aa-6dda9ac1c0b5"},"pid":18779}) 12:00:07.015 detox[78987] E artifacts-manager onLaunchApp 12:00:14.418 detox[78987] i child-process:SPAWN_STDOUT INSTRUMENTATION_RESULT: stream= Time: 0 OK (0 tests) 12:00:14.422 detox[78987] i child-process:SPAWN_STDOUT 12:00:14.428 detox[78987] i child-process:SPAWN_STDOUT INSTRUMENTATION_CODE: -1 12:00:14.429 detox[78987] i child-process:SPAWN_STDOUT 12:00:14.559 detox[78987] i child-process:SPAWN_END /Users/xxxxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:65408 -e detoxSessionId 677d2c73-1c1e-7d47-a3aa-6dda9ac1c0b5 -e debug false com.company.appname.uat.test/androidx.test.runner.AndroidJUnitRunner exited with code #0 12:00:14.561 detox[78987] i device An error occurred while waiting for the app to become ready. Waiting for disconnection... error: Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. 12:00:14.561 detox[78987] i device The app disconnected. 12:00:14.561 detox[78987] i child-process:EXEC_CMD "/Users/xxxxx/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse --remove tcp:65408 12:00:14.564 detox[78987] E device launchApp error: Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. 12:00:14.566 detox[78987] B artifacts-manager onHookFailure args: ({"error":{"name":"DetoxRuntimeError"},"hook":"beforeAll"}) 12:00:14.566 detox[78987] E artifacts-manager onHookFailure 12:00:14.566 detox[78987] E lifecycle beforeAll error: Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. 12:00:14.568 detox[78987] B lifecycle should have welcome screen 12:00:14.568 detox[78987] i lifecycle Sign In Flow: should have welcome screen 12:00:14.569 detox[78987] E lifecycle should have welcome screen 12:00:14.569 detox[78987] i lifecycle Sign In Flow: should have welcome screen [FAIL] 12:00:14.572 detox[78987] B lifecycle should show hello screen after tap 12:00:14.572 detox[78987] i lifecycle Sign In Flow: should show hello screen after tap 12:00:14.572 detox[78987] E lifecycle should show hello screen after tap 12:00:14.572 detox[78987] i lifecycle Sign In Flow: should show hello screen after tap [FAIL] 12:00:14.572 detox[78987] B lifecycle go to sign in screen and select kis 12:00:14.572 detox[78987] i lifecycle Sign In Flow: go to sign in screen and select kis 12:00:14.573 detox[78987] E lifecycle go to sign in screen and select kis 12:00:14.573 detox[78987] i lifecycle Sign In Flow: go to sign in screen and select kis [FAIL] 12:00:14.573 detox[78987] B lifecycle input username and password 12:00:14.574 detox[78987] i lifecycle Sign In Flow: input username and password 12:00:14.574 detox[78987] E lifecycle input username and password 12:00:14.575 detox[78987] i lifecycle Sign In Flow: input username and password [FAIL] 12:00:14.576 detox[78987] B lifecycle afterAll 12:00:14.576 detox[78987] i user ======================== origin: at e2e/starter.test.js:13:13 12:00:14.576 detox[78987] i user 🌜 🚀 DONE TESTING 🚀 🌛 origin: at e2e/starter.test.js:14:13 12:00:14.576 detox[78987] i user ======================== origin: at e2e/starter.test.js:15:13 12:00:14.576 detox[78987] E lifecycle afterAll 12:00:14.576 detox[78987] B artifacts-manager onRunDescribeFinish args: ({"name":"Sign In Flow"}) 12:00:14.577 detox[78987] E artifacts-manager onRunDescribeFinish 12:00:14.577 detox[78987] E lifecycle Sign In Flow 12:00:14.577 detox[78987] B artifacts-manager onRunDescribeFinish args: ({"name":"ROOT_DESCRIBE_BLOCK"}) 12:00:14.577 detox[78987] E artifacts-manager onRunDescribeFinish 12:00:14.577 detox[78987] E lifecycle run the tests 12:00:14.629 detox[78987] B lifecycle tear down environment 12:00:14.630 detox[78987] B artifacts-manager onBeforeCleanup args: () 12:00:14.630 detox[78987] E artifacts-manager onBeforeCleanup 12:00:14.631 detox[78987] i ws-client:APP_UNREACHABLE Detox can't seem to connect to the test app(s)! HINT: The test app might have crashed prematurely, or has had trouble setting up the connection. Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs 12:00:14.632 detox[78987] i child-process:EXEC_SUCCESS 12:00:14.643 detox[78987] B device free args: ({"adbName":"emulator-5554"}, {"shutdown":false}) 12:00:14.646 detox[78987] E device free 12:00:14.646 detox[78987] E lifecycle tear down environment 12:00:14.646 detox[78987] E lifecycle e2e/starter.test.js FAIL e2e/starter.test.js (38.097 s) Sign In Flow ✕ should have welcome screen (1 ms) ✕ should show hello screen after tap (1 ms) ✕ go to sign in screen and select kis ✕ input username and password (1 ms) ● Sign In Flow › should have welcome screen Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. 2 | describe('Sign In Flow', () => { 3 | beforeAll(async () => { > 4 | await device.launchApp(); | ^ 5 | await device.reloadReactNative(); 6 | await device.appLaunchArgs({ detoxPrintBusyIdleResources: 'YES', detoxRunLoopUntilIdle: 'YES' }); 7 | }); at Object.launchApp (e2e/starter.test.js:4:18) at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9) at node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:7 at Object. (node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:12) ● Sign In Flow › should show hello screen after tap Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. 2 | describe('Sign In Flow', () => { 3 | beforeAll(async () => { > 4 | await device.launchApp(); | ^ 5 | await device.reloadReactNative(); 6 | await device.appLaunchArgs({ detoxPrintBusyIdleResources: 'YES', detoxRunLoopUntilIdle: 'YES' }); 7 | }); at Object.launchApp (e2e/starter.test.js:4:18) at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9) at node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:7 at Object. (node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:12) ● Sign In Flow › go to sign in screen and select kis Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. 2 | describe('Sign In Flow', () => { 3 | beforeAll(async () => { > 4 | await device.launchApp(); | ^ 5 | await device.reloadReactNative(); 6 | await device.appLaunchArgs({ detoxPrintBusyIdleResources: 'YES', detoxRunLoopUntilIdle: 'YES' }); 7 | }); at Object.launchApp (e2e/starter.test.js:4:18) at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9) at node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:7 at Object. (node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:12) ● Sign In Flow › input username and password Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. 2 | describe('Sign In Flow', () => { 3 | beforeAll(async () => { > 4 | await device.launchApp(); | ^ 5 | await device.reloadReactNative(); 6 | await device.appLaunchArgs({ detoxPrintBusyIdleResources: 'YES', detoxRunLoopUntilIdle: 'YES' }); 7 | }); at Object.launchApp (e2e/starter.test.js:4:18) at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9) at node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:7 at Object. (node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:12) 12:00:14.655 detox[78987] i ipc dispatching event to primary-78966 /tmp/detox.primary-78966 : reportTestResults , { testResults: [ { success: false, testFilePath: '/Users/xxxxx/projects/appname-mobile/e2e/starter.test.js', testExecError: undefined, isPermanentFailure: false } ] } 12:00:14.654 detox[78966] i ws-server tester exited session 677d2c73-1c1e-7d47-a3aa-6dda9ac1c0b5 12:00:14.658 detox[78966] E ws-server@65493 connection :65408<->:65493 12:00:14.659 detox[78966] i ipc received event of : reportTestResults { testResults: [ { success: false, testFilePath: '/Users/xxxxx/projects/appname-mobile/e2e/starter.test.js', isPermanentFailure: false } ] } 12:00:14.659 detox[78966] i ipc dispatching event to socket : reportTestResultsDone { testResults: [ { success: false, testFilePath: '/Users/xxxxx/projects/appname-mobile/e2e/starter.test.js', isPermanentFailure: false } ] } 12:00:14.660 detox[78987] i ipc ## received events ## 12:00:14.660 detox[78966] i ipc broadcasting event to all known sockets listening to /tmp/detox.primary-78966 : sessionStateUpdate { testResults: [ { success: false, testFilePath: '/Users/xxxxx/projects/appname-mobile/e2e/starter.test.js', isPermanentFailure: false } ] } 12:00:14.660 detox[78987] i ipc detected event reportTestResultsDone { testResults: [ { success: false, testFilePath: '/Users/xxxxx/projects/appname-mobile/e2e/starter.test.js', isPermanentFailure: false } ] } 12:00:14.663 detox[78987] i ipc connection closed primary-78966 /tmp/detox.primary-78966 0 tries remaining of 0 12:00:14.663 detox[78987] i ipc secondary-78987 exceeded connection rety amount of or stopRetrying flag set. 12:00:14.663 detox[78966] i ipc socket disconnected secondary-78987 12:00:14.757 detox[78966] E lifecycle Command failed with exit code = 1: jest --config e2e/jest.config.js 12:00:14.758 detox[78966] i ws-server Detox server has been closed gracefully 12:00:14.760 detox[78966] E lifecycle node_modules/.bin/detox test -c android:debug --loglevel trace ```

Device logs

Device logs ``` paste your device.log here! ```

More data, please!

https://github.com/wix/Detox/assets/113888163/90efd32c-bac6-4cd8-b9ae-e63f8b3924b4

d4vidi commented 1 year ago

really appreciate and love this project

Thank you!

Mind the log:

Detox can't seem to connect to the test app(s)!

HINT: 

The test app might have crashed prematurely, or has had trouble setting up the connection.
Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs 

You need to dig up the device logs check for more specific errors. If you can't find anything overly descriptive, since you're in debug mode, consider using the https://wix.github.io/Detox/docs/api/device/#devicereversetcpport-android-only call in order to enable Javascript bundle loading from the host (this is quite a long shot).

github-actions[bot] commented 1 year ago

This issue appears to be a general usage or support question. In order to get help, please either ask a question on Stack Overflow with the detox tag, or simply join our Discord. Feel free to post your Stack Overflow question here for more visibility! For more information about our policy on issues, refer to this discussion.