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

Android: Running instrumentation requires ADB to be in path #651

Closed
robhanlon22 opened this issue Mar 28, 2018 · 3 comments
Closed

Android: Running instrumentation requires ADB to be in path #651

robhanlon22 opened this issue Mar 28, 2018 · 3 comments

Comments

@robhanlon22
Copy link
Contributor

Description

Hi there, I'm experiencing what seems to be a similar issue to this one: #419 Detox successfully installs the debug Android app on the emulator, but then is unable to run my tests.

Steps to Reproduce

I followed the instructions to set up detox for Android, successfully built the debug app and androidTest app, and then ran detox test.

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.2
  • React Native: 0.54.3
  • Node: 8.9.1
  • Device: Android Emulator
  • Xcode: N/A
  • macOS: 10.12.6

Device and verbose Detox logs

yarn run v1.5.1
$ /Users/me/Code/wc/wc-react-native/client/node_modules/.bin/detox test -c android.emu.debug -l verbose
node_modules/.bin/jest __e2e__ --config=jest.e2e.js --runInBand --testNamePattern='^((?!:ios:).)*$'
detox-server info 09:40:06: server listening on localhost:54790...
detox verb ws onOpen [object Object]
detox verb ws send: {"type":"login","params":{"sessionId":"41326c08-4004-ebdb-cbba-d72bb6ca8dbd","role":"tester"},"messageId":0}
detox verb ws onMessage: {"type":"loginSuccess","params":{"sessionId":"41326c08-4004-ebdb-cbba-d72bb6ca8dbd","role":"tester"},"messageId":0}
detox verb ws  
detox verb 1: /Users/me/Library/Android/sdk/tools/emulator -list-avds --verbose 
detox verb 1: stdout: wc-react-native
detox verb 1: stdout: 
detox verb /Users/me/Library/Android/sdk/tools/emulator -verbose -gpu host -no-audio @wc-react-native
detox verb 2: /Users/me/Library/Android/sdk/platform-tools/adb  devices 
detox verb 2: stdout: List of devices attached
detox verb 2: stdout: emulator-5554	device
detox verb 2: stdout: 
detox verb 2: stdout: 
detox verb 3: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop dev.bootcomplete 
detox verb 3: stdout: 1
detox verb 3: stdout: 
detox verb 4: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell input keyevent 82 
detox verb 5: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.wcrnclient 
detox verb 5: stdout: Success
detox verb 5: stdout: 
detox verb 6: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.wcrnclient.test 
detox verb 6: stdout: Success
detox verb 6: stdout: 
detox verb 7: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop ro.build.version.sdk 
detox verb 7: stdout: 23
detox verb 7: stdout: 
detox verb 8: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -rg /Users/me/Code/wc/wc-react-native/client/android/app/build/outputs/apk/debug/app-debug.apk 
detox verb 8: stdout: [  0%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  1%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  2%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  3%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  3%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  4%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  5%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  6%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  6%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  7%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  8%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  9%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [  9%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 10%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 11%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 12%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 12%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 13%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 14%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 15%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 15%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 16%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 17%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 18%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 18%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 19%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 20%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 21%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 21%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 22%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 23%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 24%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 24%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 25%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 26%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 27%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 27%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 28%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 29%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 30%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 30%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 31%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 32%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 33%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 33%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 34%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 35%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 36%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 36%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 37%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 38%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 39%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 39%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 40%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 41%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 42%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 42%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 43%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 44%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 45%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 45%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 46%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 47%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 48%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 48%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 49%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 50%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 51%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 51%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 52%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 53%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 54%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 54%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 55%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 56%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 57%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 57%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 58%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 59%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 60%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 60%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 61%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 62%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 63%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 63%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 64%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 65%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 66%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 66%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 67%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 68%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 69%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 69%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 70%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 71%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 72%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 72%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 73%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 74%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 75%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 75%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 76%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 77%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 78%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 78%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 79%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 80%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 81%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 81%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 82%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 83%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 84%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 84%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 85%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 86%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 87%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 87%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 88%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 89%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 90%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 90%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 91%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 92%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 93%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 93%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 94%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 95%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 96%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 96%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 97%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 98%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 99%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [ 99%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: [100%] /data/local/tmp/app-debug.apk
detox verb 8: stdout: /Users/me/Code/wc/wc-react-native/client/android/app/build/outputs/apk/debug/app-debug.apk: 1 file pushed. 255.9 MB/s (8723031 bytes in 0.033s)
detox verb 8: stdout: 	pkg: /data/local/tmp/app-debug.apk
detox verb 8: stdout: Success
detox verb 8: stdout: 
detox verb 9: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop ro.build.version.sdk 
detox verb 9: stdout: 23
detox verb 9: stdout: 
detox verb 10: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -rg /Users/me/Code/wc/wc-react-native/client/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk 
detox verb 10: stdout: [  4%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [  9%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 14%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 19%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 24%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 29%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 34%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 39%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 44%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 48%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 53%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 58%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 63%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 68%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 73%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 78%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 83%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 88%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 92%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [ 97%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: [100%] /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: /Users/me/Code/wc/wc-react-native/client/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk: 1 file pushed. 143.1 MB/s (1338985 bytes in 0.009s)
detox verb 10: stdout: 	pkg: /data/local/tmp/app-debug-androidTest.apk
detox verb 10: stdout: Success
detox verb 10: stdout: 
detox verb 11: /Users/me/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am force-stop com.wcrnclient 
detox verb adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:54790 -e detoxSessionId 41326c08-4004-ebdb-cbba-d72bb6ca8dbd -e debug false com.wcrnclient.test/android.support.test.runner.AndroidJUnitRunner 
detox verb Instrumentation spawned, childProcess.pid:  undefined
detox verb ws send: {"type":"isReady","params":{},"messageId":-1000}
  console.error node_modules/jest-jasmine2/build/jasmine/Env.js:160
    Unhandled error

  console.error node_modules/jest-jasmine2/build/jasmine/Env.js:161
    Error: spawn adb ENOENT
        at _errnoException (util.js:1024:11)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
        at onErrorNT (internal/child_process.js:372:16)
        at _combinedTickCallback (internal/process/next_tick.js:138:11)
        at process._tickCallback (internal/process/next_tick.js:180:9)
@robhanlon22
Copy link
Contributor Author

Closing this—it was a PATH issue. If you're coming to this issue with the same problem—make sure you have the adb in your PATH:

PATH=…:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin:…

@rotemmiz
Copy link
Member

Actually it is indeed an issue with the implementation. Detox should not rely on adb to be in path.

@rotemmiz rotemmiz reopened this Mar 28, 2018
@LeoNatan
Copy link
Contributor

LeoNatan commented Mar 30, 2018

@rotemmiz Why was this issue not labeled correctly? Since it's hard to remember to go back to issues after closing them in commits, please label issues before working on them.

@rotemmiz rotemmiz changed the title Android: spawn adb ENOENT Android: Running instrumentation requires ADB to be in path Apr 4, 2018
@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants