Esempio n. 1
0
 def _adb_disconnect(self, device):
     try:
         if adb.device_is_ready(device.remote_connect_url):
             if self.shutdown_emulator_on_disconnect and device.serial.startswith('emulator'):
                 adb.shutdown_emulator(device.remote_connect_url)
                 log.info("%s has been released" % device)
                 return
             else:
                 adb.disconnect(device.remote_connect_url)
     except Exception:
         log.exception("Error during disconnect by ADB for %s" % device)
Esempio n. 2
0
 def _adb_disconnect(self, device):
     try:
         if adb.device_is_ready(device.remote_connect_url):
             if self.shutdown_emulator_on_disconnect and device.serial.startswith('emulator'):
                 adb.shutdown_emulator(device.remote_connect_url)
                 log.info("%s has been released" % device)
                 return
             else:
                 adb.disconnect(device.remote_connect_url)
     except Exception:
         log.exception("Error during disconnect by ADB for %s" % device)
Esempio n. 3
0
 def connected_devices_check(self):
     for device_group in self.device_groups:
         for device in device_group.get("connected_devices"):
             if not adb.device_is_ready(device.remote_connect_url):
                 log.warning("ADB connection with device {} was lost. "
                             "We'll try to connect a new one.".format(device))
                 self._delete_device_from_group(device, device_group)
                 self._disconnect_device(device)
                 log.warning("Still connected {} in group '{}'".format(
                     device_group.get("connected_devices"), device_group.get("group_name")))
             else:
                 adb.echo_ping(device.remote_connect_url)
Esempio n. 4
0
 def connected_devices_check(self):
     for device_group in self.device_groups:
         for device in device_group.get("connected_devices"):
             if not adb.device_is_ready(device.remote_connect_url):
                 log.warning("ADB connection with device {} was lost. "
                             "We'll try to connect a new one.".format(device))
                 self._delete_device_from_group(device, device_group)
                 self._disconnect_device(device)
                 log.warning("Still connected {} in group '{}'".format(
                     device_group.get("connected_devices"), device_group.get("group_name")))
             else:
                 adb.echo_ping(device.remote_connect_url)