Skip to content
New issue

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

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

Already on GitHub? # to your account

Can't run Detox Android on AppCenter - adb -s shell pm install failed with code null #3711

Closed
dittmarconsulting opened this issue Nov 17, 2022 · 6 comments

Comments

@dittmarconsulting
Copy link

dittmarconsulting commented Nov 17, 2022

Description

I know it's quite tricky to get Detox running on AppCenter as the platform has not yet geared up to support Detox but I can't see why it shouldn't.

AppCenter runs on MacOS and so does my local machine. The only difference is I had to install the Android SDK tools manually, which is not a problem. After that, I had a pretty similar environment to run Detox locally and on AppCenter in release mode.

Here my Detox setup for the release build with a flavor releaseE2E:

{
  "configurations": {
    "android.emu.ci": {
      "binaryPath": "android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk",
      "testBinaryPath": "android/app/build/outputs/apk/androidTest/releaseE2E/app-releaseE2E-androidTest.apk",
      "build": "cd android && RN_SRC_EXT=true ./gradlew assembleReleaseE2E assembleAndroidTest -DtestBuildType=releaseE2E && cd ..",
      "type": "android.emulator",
      "device": {
        "avdName": "Pixel_API_29_AOSP"
      }
    }
  },
  "test-runner": "jest",
  "runner-config": "e2e/config.json"
}

My first test was to run Detox locally, which of course performed as expected. I didn't bother to log in trace mode as verbose gave me the same important log. Please pay attention to SPAWN_CMD, #19

INFO:  [test.js] DETOX_CONFIGURATION="android.emu.ci" DETOX_LOGLEVEL="verbose" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1668577332310 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
DEBUG: [WSS_CREATE] Detox server listening on localhost:59914...
DEBUG: [WSS_CONNECTION, #59915] registered a new connection.
DEBUG: [EXEC_CMD, #0] "/Users/testuser/Library/Android/sdk/emulator/emulator" -list-avds --verbose
DEBUG: [EXEC_CMD, #1] "/Users/testuser/Library/Android/sdk/emulator/emulator" -version 
DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 3, patch: 11, toString: [Function: toString] }
DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "Pixel_API_29_AOSP"
DEBUG: [EXEC_CMD, #2] "/Users/testuser/Library/Android/sdk/platform-tools/adb"  devices
DEBUG: [EXEC_SUCCESS, #2] List of devices attached
emulator-5554  device

DEBUG: [DEVICE_LOOKUP] Found a matching & free device emulator-5554
DEBUG: [ALLOCATE_DEVICE] Settled on emulator-5554
DEBUG: [EXEC_CMD, #3] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop dev.bootcomplete"
DEBUG: [EXEC_CMD, #4] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop ro.build.version.sdk"
DEBUG: [EXEC_CMD, #5] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global animator_duration_scale 0"
DEBUG: [EXEC_CMD, #6] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global window_animation_scale 0"
DEBUG: [EXEC_CMD, #7] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global transition_animation_scale 0"
DEBUG: [EXEC_CMD, #8] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
DEBUG: [EXEC_CMD, #9] "/Users/testuser/Library/Android/sdk/build-tools/31.0.0/aapt" dump badging "/Users/testuser/Temp/mono-repo/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk"
DEBUG: [EXEC_CMD, #10] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop com.testapp"
DEBUG: [EXEC_CMD, #11] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list packages com.testapp"
DEBUG: [EXEC_CMD, #12] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list packages com.testapp.test"
DEBUG: [EXEC_CMD, #13] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop com.testapp"
DEBUG: [EXEC_CMD, #14] "/Users/testuser/Library/Android/sdk/build-tools/31.0.0/aapt" dump xmlstrings "/Users/testuser/Temp/mono-repo/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk" AndroidManifest.xml
DEBUG: [EXEC_CMD, #15] "/Users/testuser/Library/Android/sdk/build-tools/31.0.0/aapt" dump xmlstrings "/Users/testuser/Temp/mono-repo/packages/testapp/android/app/build/outputs/apk/androidTest/releaseE2E/app-releaseE2E-androidTest.apk" AndroidManifest.xml
DEBUG: [EXEC_CMD, #16] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "rm -fr /data/local/tmp/detox"
DEBUG: [EXEC_CMD, #17] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "mkdir -p /data/local/tmp/detox"
DEBUG: [EXEC_CMD, #18] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 push "/Users/testuser/Temp/mono-repo/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk" "/data/local/tmp/detox/Application.apk"
DEBUG: [SPAWN_CMD, #19, cpid=14339] /Users/testuser/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk
DEBUG: [SPAWN_END, #19, cpid=14339] /Users/testuser/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
DEBUG: [EXEC_CMD, #20] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 push "/Users/testuser/Temp/mono-repo/packages/testapp/android/app/build/outputs/apk/androidTest/releaseE2E/app-releaseE2E-androidTest.apk" "/data/local/tmp/detox/Test.apk"
DEBUG: [SPAWN_CMD, #21, cpid=14343] /Users/testuser/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Test.apk
DEBUG: [SPAWN_END, #21, cpid=14343] /Users/testuser/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
DEBUG: [EXEC_CMD, #22] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "date +\"%m-%d %T.000\""
DEBUG: [EXEC_CMD, #23] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:59914 tcp:59914
DEBUG: [EXEC_CMD, #24] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list instrumentation"
DEBUG: [SPAWN_CMD, #25, cpid=14347] /Users/testuser/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:59914 -e detoxSessionId 59b557b3-21f2-ce2d-7f60-058fb5a33041 -e debug false com.testapp.test/androidx.test.runner.AndroidJUnitRunner
DEBUG: [EXEC_CMD, #26] "/Users/testuser/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"au\.com\.testapp$\""
DEBUG: [WSS_CONNECTION, #60001] registered a new connection.
INFO:  Hometest is assigned to emulator-5554 (Pixel_API_29_AOSP)
INFO:  Hometest > Login View & User Profile: should check Login button exists and click on it
INFO:  Hometest > Login View & User Profile: should check Login button exists and click on it [OK]

So far so good. My assumption was that it should run on AppCenter with the same configuration but it failed on SPAWN_CMD, #19 with terminated with SIGTERM

INFO:  [test.js] DETOX_CONFIGURATION="android.emu.ci" DETOX_HEADLESS=true DETOX_LOGLEVEL="verbose" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1668586862166 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
DEBUG: [WSS_CREATE] Detox server listening on localhost:50100...
DEBUG: [WSS_CONNECTION, #50101] registered a new connection.
DEBUG: [EXEC_CMD, #0] "/Users/runner/Library/Android/sdk/emulator/emulator" -list-avds --verbose
DEBUG: [EXEC_CMD, #1] "/Users/runner/Library/Android/sdk/emulator/emulator" -version -no-window
DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 3, patch: 13, toString: [Function: toString] }
DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "Pixel_API_29_AOSP"
DEBUG: [EXEC_CMD, #2] "/Users/runner/Library/Android/sdk/platform-tools/adb"  devices
DEBUG: [EXEC_SUCCESS, #2] List of devices attached
emulator-5554  device

DEBUG: [DEVICE_LOOKUP] Found a matching & free device emulator-5554
DEBUG: [ALLOCATE_DEVICE] Settled on emulator-5554
DEBUG: [EXEC_CMD, #3] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop dev.bootcomplete"
DEBUG: [EXEC_CMD, #4] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop ro.build.version.sdk"
DEBUG: [EXEC_CMD, #5] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global animator_duration_scale 0"
DEBUG: [EXEC_CMD, #6] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global window_animation_scale 0"
DEBUG: [EXEC_CMD, #7] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global transition_animation_scale 0"
DEBUG: [EXEC_CMD, #8] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
DEBUG: [EXEC_CMD, #9] "/Users/runner/Library/Android/sdk/build-tools/33.0.0/aapt" dump badging "/Users/runner/work/1/s/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk"
DEBUG: [EXEC_CMD, #10] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop com.testapp"
DEBUG: [EXEC_CMD, #11] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list packages com.testapp"
DEBUG: [EXEC_CMD, #12] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list packages com.testapp.test"
DEBUG: [EXEC_CMD, #13] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop com.testapp"
DEBUG: [EXEC_CMD, #14] "/Users/runner/Library/Android/sdk/build-tools/33.0.0/aapt" dump xmlstrings "/Users/runner/work/1/s/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk" AndroidManifest.xml
DEBUG: [EXEC_CMD, #15] "/Users/runner/Library/Android/sdk/build-tools/33.0.0/aapt" dump xmlstrings "/Users/runner/work/1/s/packages/testapp/android/app/build/outputs/apk/androidTest/releaseE2E/app-releaseE2E-androidTest.apk" AndroidManifest.xml
DEBUG: [EXEC_CMD, #16] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "rm -fr /data/local/tmp/detox"
DEBUG: [EXEC_CMD, #17] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "mkdir -p /data/local/tmp/detox"
DEBUG: [EXEC_CMD, #18] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 push "/Users/runner/work/1/s/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk" "/data/local/tmp/detox/Application.apk"
DEBUG: [SPAWN_CMD, #19, cpid=75638] /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk
DEBUG: [SPAWN_END, #19, cpid=75638] /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk terminated with SIGTERM
DEBUG: [SPAWN_CMD, #19, cpid=77421] (Retry #1) /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk
DEBUG: [SPAWN_END, #19, cpid=77421] /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk terminated with SIGTERM
DEBUG: [SPAWN_CMD, #19, cpid=79522] (Retry #2) /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk
DEBUG: [SPAWN_END, #19, cpid=79522] /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk terminated with SIGTERM
DEBUG: [SPAWN_CMD, #19, cpid=81651] (Retry #3) /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk
DEBUG: [SPAWN_END, #19, cpid=81651] /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk terminated with SIGTERM
ERROR: ChildProcessError: `/Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk` failed with code null
   at ChildProcess.<anonymous> (/Users/runner/work/1/s/node_modules/child-process-promise/lib/index.js:132:23)
   at ChildProcess.emit (node:events:513:28)
   at maybeClose (node:internal/child_process:1100:16)
   at Socket.<anonymous> (node:internal/child_process:458:11)
   at Socket.emit (node:events:513:28)
   at Pipe.<anonymous> (node:net:301:12)
INFO:  Hometest is assigned to undefined
INFO:  Hometest > Login View & User Profile: should check Login button exists and click on it
INFO:  Hometest > Login View & User Profile: should check Login button exists and click on it [FAIL]

I went through countless bug reports and blogs and found a solution from @d4vidi where he suggested installing the app-releaseE2E-androidTest.apk via adb install command and use the --reuse flag in the Detox test like that

adb -s emulator-5554 install "$APPCENTER_SOURCE_DIRECTORY/packages/testapp/android/app/build/outputs/apk/androidTest/releaseE2E/app-releaseE2E-androidTest.apk"

detox test --headless --reuse -l verbose -c android.emu.ci 

that resulted in another issue INSTRUMENTATION_FAILED, although the log of adb -s emulator-5554 shell pm list instrumentation clearly shows that the app has the correct instrumentation

instrumentation:com.testapp.test/androidx.test.runner.AndroidJUnitRunner (target=com.testapp)
INFO:  [test.js] DETOX_CONFIGURATION="android.emu.ci" DETOX_HEADLESS=true DETOX_LOGLEVEL="verbose" DETOX_REPORT_SPECS=true DETOX_REUSE=true DETOX_START_TIMESTAMP=1668818139630 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
DEBUG: [WSS_CREATE] Detox server listening on localhost:49883...
DEBUG: [WSS_CONNECTION, #49884] registered a new connection.
DEBUG: [EXEC_CMD, #0] "/Users/runner/Library/Android/sdk/emulator/emulator" -list-avds --verbose
DEBUG: [EXEC_CMD, #1] "/Users/runner/Library/Android/sdk/emulator/emulator" -version -no-window
DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 3, patch: 13, toString: [Function: toString] }
DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "Pixel_API_29_AOSP"
DEBUG: [EXEC_CMD, #2] "/Users/runner/Library/Android/sdk/platform-tools/adb"  devices
DEBUG: [EXEC_SUCCESS, #2] List of devices attached
emulator-5554	device

DEBUG: [DEVICE_LOOKUP] Found a matching & free device emulator-5554
DEBUG: [ALLOCATE_DEVICE] Settled on emulator-5554
DEBUG: [EXEC_CMD, #3] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop dev.bootcomplete"
DEBUG: [EXEC_CMD, #4] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop ro.build.version.sdk"
DEBUG: [EXEC_CMD, #5] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global animator_duration_scale 0"
DEBUG: [EXEC_CMD, #6] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global window_animation_scale 0"
DEBUG: [EXEC_CMD, #7] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global transition_animation_scale 0"
DEBUG: [EXEC_CMD, #8] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
DEBUG: [EXEC_CMD, #9] "/Users/runner/Library/Android/sdk/build-tools/33.0.0/aapt" dump badging "/Users/runner/work/1/s/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk"
DEBUG: [EXEC_CMD, #10] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "date +\"%m-%d %T.000\""
DEBUG: [EXEC_CMD, #11] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:49883 tcp:49883
DEBUG: [EXEC_CMD, #12] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list instrumentation"
DEBUG: [SPAWN_CMD, #13, cpid=19850] /Users/runner/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:49883 -e detoxSessionId 31e44bbc-39a5-7b25-bd7d-cfc60f68ddda -e debug false com.testapp.test/androidx.test.runner.AndroidJUnitRunner
DEBUG: [EXEC_CMD, #14] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"au\.com\.testapp$\""
ERROR: [SPAWN_STDERR, #13, cpid=19850] android.util.AndroidException: INSTRUMENTATION_FAILED: com.testapp.test/androidx.test.runner.AndroidJUnitRunner

ERROR: [SPAWN_STDERR, #13, cpid=19850] 	at com.android.commands.am.Instrument.run(Instrument.java:519)
	at com.android.commands.am.Am.runInstrument(Am.java:202)
	at com.android.commands.am.Am.onRun(Am.java:80)
	at com.android.internal.os.BaseCommand.run(BaseCommand.java:60)
	at com.android.commands.am.Am.main(Am.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)

After that I thought I would install the release APK app-releaseE2E.apk via adb install command and use the --reuse flag in the Detox test like that

adb -s emulator-5554 install "$APPCENTER_SOURCE_DIRECTORY/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E"

detox test --headless --reuse -l verbose -c android.emu.ci 

that resulted in another issue No instrumentation runner found and the log of adb -s emulator-5554 shell pm list instrumentation showed no output

INFO:  [test.js] DETOX_CONFIGURATION="android.emu.ci" DETOX_HEADLESS=true DETOX_LOGLEVEL="verbose" DETOX_REPORT_SPECS=true DETOX_REUSE=true DETOX_START_TIMESTAMP=1668509578916 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e
DEBUG: [WSS_CREATE] Detox server listening on localhost:49901...
DEBUG: [WSS_CONNECTION, #49902] registered a new connection.
DEBUG: [EXEC_CMD, #0] "/Users/runner/Library/Android/sdk/emulator/emulator" -list-avds --verbose
DEBUG: [EXEC_CMD, #1] "/Users/runner/Library/Android/sdk/emulator/emulator" -version -no-window
DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 3, patch: 13, toString: [Function: toString] }
DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "Pixel_API_29_AOSP"
DEBUG: [EXEC_CMD, #2] "/Users/runner/Library/Android/sdk/platform-tools/adb"  devices
DEBUG: [EXEC_SUCCESS, #2] List of devices attached
emulator-5554   device

DEBUG: [DEVICE_LOOKUP] Found a matching & free device emulator-5554
DEBUG: [ALLOCATE_DEVICE] Settled on emulator-5554
DEBUG: [EXEC_CMD, #3] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop dev.bootcomplete"
DEBUG: [EXEC_CMD, #4] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop ro.build.version.sdk"
DEBUG: [EXEC_CMD, #5] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global animator_duration_scale 0"
DEBUG: [EXEC_CMD, #6] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global window_animation_scale 0"
DEBUG: [EXEC_CMD, #7] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "settings put global transition_animation_scale 0"
DEBUG: [EXEC_CMD, #8] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
DEBUG: [EXEC_CMD, #9] "/Users/runner/Library/Android/sdk/build-tools/33.0.0/aapt" dump badging "/Users/runner/work/1/s/packages/testapp/android/app/build/outputs/apk/releaseE2E/app-releaseE2E.apk"
DEBUG: [EXEC_CMD, #10] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "date +\"%m-%d %T.000\""
DEBUG: [EXEC_CMD, #11] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:49901 tcp:49901
DEBUG: [EXEC_CMD, #12] "/Users/runner/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list instrumentation"
INFO:  Hometest is assigned to emulator-5554 (Pixel_API_29_AOSP)
INFO:  Hometest > Login View & User Profile: should check Login button exists and click on it
INFO:  Hometest > Login View & User Profile: should check Login button exists and click on it [FAIL]

DEBUG: [WSS_CLOSE] Detox server has been closed gracefully
FAIL e2e/home/home.spec.ts
   Hometest  Login View & User Profile  should check Login button exists and click on it

    No instrumentation runner found on device emulator-5554 for package com.testapp

      14 |
      15 | beforeAll(async () => {
    > 16 |   await device.launchApp({
         |                ^
      17 |     newInstance: false
      18 |   });
      19 |

      at Object.<anonymous> (init.ts:16:16)

At this point, I'm out of ideas. If someone has another suggestion please share it with me.

@d4vidi perhaps you have an idea?

I have also posted that issue on SO

Your environment

Detox version: 19.12.6
React Native version: 0.67.0
Node version: 16.15.0
Device model: Pixel_API_29_AOSP (system-images;android-30;aosp_atd;x86)
OS: Android
Test-runner (select one): jest

@caiorrsdeg
Copy link

I'm having the same issue but in my case it's happening on my local machine and using the example app from the repository. Would you mind trying to run that example on your machine as well?

@noomorph
Copy link
Collaborator

I just wonder if it can be something ProGuard-related. 🤔

I'm not very familiar with the context but is it possible to reproduce that for your debug app flavor?

@dittmarconsulting
Copy link
Author

Thanks for brainstorming @noomorph but in my case, I turned off shrinking in my app for testing purposes

minifyEnabled false

Also, the release version runs fine locally without any code changes.

@stale
Copy link

stale bot commented Dec 20, 2022

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 Dec 20, 2022
@dittmarconsulting
Copy link
Author

I still don't have a solution to this. I will try a few other ways. I really hope someone from the Detox team could help me out here.

@stale
Copy link

stale bot commented Dec 31, 2022

The issue has been closed for inactivity.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants