The question has been asked elsewhere, but I do not see any solutions for this...
I have a Python script that contains subprocess calls of the form:
source_density = subprocess.check_output(["adb", device_dhm1, "-P8080", "-s", source, "shell", "wm density | head -2 | tail -1"])
When running this script through cmd, everything runs fine. However now I am trying to run it through Jenkins and I am getting the following error output:
======================================================================
ERROR: test_sanity (__main__.ABC)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/user123/.jenkins/workspace/Test/Jenkins-Source-Sanity.py", line 145, in test_sanity
source_density = subprocess.check_output(["adb", device_dhm1, "-P8080", "-s", source, "shell", "wm density | head -2 | tail -1"])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 216, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
adb. You can check thePATHenvironment variable./usr/bin/adbshell=Truein the call of check_output