How to use the uiautomator2.adbutils.AdbDevice function in uiautomator2

To help you get started, we’ve selected a few uiautomator2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openatx / uiautomator2 / uiautomator2 / adbutils.py View on Github external
def iter_device(self):
        """
        Returns:
            list of DeviceItem
        """
        with self.connect() as c:
            c.send("host:devices")
            c.check_okay()
            output = c.read_string()
            for line in output.splitlines():
                parts = line.strip().split("\t")
                if len(parts) != 2:
                    continue
                if parts[1] == 'device':
                    yield AdbDevice(self, parts[0])
github openatx / uiautomator2 / uiautomator2 / adbutils.py View on Github external
def device_with_serial(self, serial=None):
        if not serial:
            return self.must_one_device()
        return AdbDevice(self, serial)