diff options
author | Brendan Jackman <brendan.jackman@arm.com> | 2017-09-21 12:32:18 +0100 |
---|---|---|
committer | Brendan Jackman <brendan.jackman@arm.com> | 2017-10-11 13:40:25 +0100 |
commit | da22befd8006e4927a039c503fb688f3643f07a5 (patch) | |
tree | c11d6c3495a211d360ef0056e9176e6544fe52da | |
parent | dc453ad8916cfb914c9dafaad8b0b440d3a4b443 (diff) | |
download | devlib-da22befd8006e4927a039c503fb688f3643f07a5.tar.gz |
libs/android: Add get_adb_command function
This is just like adb_command but instead of executing the command it just
returns it.
-rw-r--r-- | devlib/utils/android.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/devlib/utils/android.py b/devlib/utils/android.py index 0cdd2b0..b5dabaf 100644 --- a/devlib/utils/android.py +++ b/devlib/utils/android.py @@ -442,13 +442,16 @@ def adb_list_devices(adb_server=None): return devices -def adb_command(device, command, timeout=None,adb_server=None): +def get_adb_command(device, command, timeout=None,adb_server=None): _check_env() device_string = "" if adb_server != None: device_string = ' -H {}'.format(adb_server) device_string += ' -s {}'.format(device) if device else '' - full_command = "adb{} {}".format(device_string, command) + return "adb{} {}".format(device_string, command) + +def adb_command(device, command, timeout=None,adb_server=None): + full_command = get_adb_command(device, command, timeout, adb_server) logger.debug(full_command) output, _ = check_output(full_command, timeout, shell=True) return output |