(context, initial_devices)
| 482 | |
| 483 | |
| 484 | async def find_device(context, initial_devices): |
| 485 | if context.managed: |
| 486 | print("Waiting for managed device - this may take several minutes") |
| 487 | while True: |
| 488 | new_devices = set(await list_devices()).difference(initial_devices) |
| 489 | if len(new_devices) == 0: |
| 490 | await asyncio.sleep(1) |
| 491 | elif len(new_devices) == 1: |
| 492 | serial = new_devices.pop() |
| 493 | print(f"Serial: {serial}") |
| 494 | return serial |
| 495 | else: |
| 496 | exit(f"Found more than one new device: {new_devices}") |
| 497 | else: |
| 498 | return context.connected |
| 499 | |
| 500 | |
| 501 | # An older version of this script in #121595 filtered the logs by UID instead. |
no test coverage detected
searching dependent graphs…