attachDevice method

Future<AppSession> attachDevice({
  1. required DeviceTarget device,
})

Attach in device mode — bind an OS-level device with no Flutter VM. Only backend + device are live; Flutter perception (scene reader, resolver, interactor) is not. Drive via screenshots + coordinate taps.

Implementation

Future<AppSession> attachDevice({required DeviceTarget device}) async {
  final existing = _pool[device.id];
  CallProgress.checkAlive();
  if (existing != null) await _drop(existing);
  final app = AppSession.bindDevice(device: device);
  _pool[device.id] = app;
  _ownedDevices.add(device.id);
  _active = app;
  return app;
}