1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

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).
This commit is contained in:
Pierre-Clément Tosi 2019-05-14 12:22:23 +01:00 committed by Marc Bonnici
parent 0d798f1c4f
commit 6b414cc291

View File

@ -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