Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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])
def device_with_serial(self, serial=None):
if not serial:
return self.must_one_device()
return AdbDevice(self, serial)