mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
libs/android: Add get_adb_command function
This is just like adb_command but instead of executing the command it just returns it.
This commit is contained in:
parent
dc453ad891
commit
da22befd80
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user