From 6b414cc291d0b18ece64e5c9e9984a4376976679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?= Date: Tue, 14 May 2019 12:22:23 +0100 Subject: [PATCH] utils.adb_shell: Move from 'echo CMD | su' to '-c' Move from the current implementation (piping the command to su) which has unexpected behaviours to the '-c' su flag (which then becomes required). --- devlib/utils/android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/utils/android.py b/devlib/utils/android.py index dd8c5ed..71907d8 100755 --- a/devlib/utils/android.py +++ b/devlib/utils/android.py @@ -431,7 +431,7 @@ def adb_shell(device, command, timeout=None, check_exit_code=False, if device is not None: parts += ['-s', device] parts += ['shell', - command if not as_root else 'echo {} | su'.format(quote(command))] + command if not as_root else 'su -c {}'.format(quote(command))] logger.debug(' '.join(quote(part) for part in parts)) # On older combinations of ADB/Android versions, the adb host command always