diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-03-27 12:42:22 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-03-27 13:20:43 +0000 |
commit | 34f694a06a0ba2fac36d50cea50dda6d2215afc5 (patch) | |
tree | 201793f7f72922c794149e3f16e8312e7e2e5d93 /automated/lib | |
parent | 9968eb96755f2eabf22d1b55d6b98bae3d16f1d9 (diff) |
android-test-lib: run 'adb shell which' with root permission
Root permission is required to locate some commands. For example:
T440 test-definitions # adb shell which tee-supplicant
T440 test-definitions # adb shell "echo which tee-supplicant | su"
/system/bin/tee-supplicant
T440 test-definitions # adb shell ls -l /system/bin/tee-supplicant
ls: /system/bin/tee-supplicant: Permission denied
Change-Id: I129d55d12b081ad4e5cf4c4fd72d1f905223b9a4
Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/lib')
-rwxr-xr-x | automated/lib/android-test-lib | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib index a4fd136..7330c8b 100755 --- a/automated/lib/android-test-lib +++ b/automated/lib/android-test-lib @@ -153,7 +153,7 @@ adb_shell_which() { cmd="$1" # Only latest version adb able to return exit code. # Check if output of which is empty is a more reliable way. - which_output="$(adb shell "which ${cmd}")" + which_output="$(adb shell "echo which ${cmd} | su")" info_msg "Output of which: *${which_output}*" if [ -n "${which_output}" ]; then return 0 |