attachDevice

suspend fun attachDevice(serial: String, timeouts: Timeouts = Timeouts(), options: DeviceOptions = DeviceOptions()): Device(source)

Attach serial. The underlying device session holds the device's per-serial lock until Device.detach; if another session holds it, attachment fails with DeviceBusyException — at once, or after DeviceOptions.waitForDevice. Rejected locally without an RPC once the connection is closed or its liveness stream ended unexpectedly.