When running android ui tests with detox test command the android emulator is spun up but it does not open the app, seemingly due to this - detox verb Instrumentation spawned, childProcess.pid: undefined
Running detox test --configuration android.emu.debug --loglevel verbose
Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.debug --loglevel verbose
at checkExecSyncError (child_process.js:574:11)
at Object.execSync (child_process.js:611:13)
at runMocha (/private/var/jenkins/workspace/act-native-appconfig_PR-123-HGVBDYGD4JOXXAWH43WZ4NIILUFSNMLMYZXKVPWF7KHDRXLBPERA/AppConfigExample/node_modules/detox/local-cli/detox-test.js:61:6)
at Object.
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
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 error.
I am having a similar error while Detox is trying to install the APK on the emulator
ChildProcessError: Command failed: /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-5556 install -r -g /Users/user/workspace/mobileTech/android/app/build/outputs/apk/debug/app-debug.apk
adb: failed to install /Users/user/workspace/mobileTech/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
``/Users/user/Library/Android/sdk/platform-tools/adb -s emulator-5556 install -r -g /Users/user/workspace/mobileTech/android/app/build/outputs/apk/debug/app-debug.apk (exited with error code 1)
I have tried adding platform-tools to the path to no avail. Perhaps I am not doing it properly. If this is truly the solution I would appreciate a guide for doing this. Thanks.
@ararog anymore details on what you did?
I have this?
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH"
@evanjmg this line was more than enough to get detox started working for me.
I have this and it's sourced with my zshrc and it still cannot find my avd and it's still using the wrong path - version detox 6.0.4, gradle 2.4.1, react native 0.52.1. Detox build runs fine, but detox test errors
ChildProcessError: Command failed: /usr/local/opt/android-sdk/tools/emulator -list-avds --verbose
/bin/sh: /usr/local/opt/android-sdk/tools/emulator: No such file or directory
`/usr/local/opt/android-sdk/tools/emulator -list-avds --verbose` (exited with error code 127)
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.
The issue has been closed for inactivity.
Most helpful comment
I have this and it's sourced with my zshrc and it still cannot find my avd and it's still using the wrong path - version detox 6.0.4, gradle 2.4.1, react native 0.52.1. Detox build runs fine, but detox test errors