1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-02-27 15:07:50 +00:00

target: add support to kill/restart and ADB connection

Sometimes it could be useful to disconnect from the target, for example
when a "pass thought" energy monitor is used to control the USB
connection to the device.

This patch adds a couple of utility methods which allows to kill the ADB
server and restart it while waiting for the device to be ready to accept
new connections.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
Patrick Bellasi 2017-07-12 12:30:30 +01:00
parent f26f942723
commit 0c7eb9e91e

View File

@ -1077,6 +1077,12 @@ class AndroidTarget(Target):
def clear_logcat(self): def clear_logcat(self):
adb_command(self.adb_name, 'logcat -c', timeout=30) adb_command(self.adb_name, 'logcat -c', timeout=30)
def adb_kill_server(self, timeout=30):
adb_command(self.adb_name, 'kill-server', timeout)
def adb_wait_for_device(self, timeout=30):
adb_command(self.adb_name, 'wait-for-device', timeout)
def adb_reboot_bootloader(self, timeout=30): def adb_reboot_bootloader(self, timeout=30):
adb_command(self.adb_name, 'reboot-bootloader', timeout) adb_command(self.adb_name, 'reboot-bootloader', timeout)