readRunnerSessionFile function

DevSessionDiscovery? readRunnerSessionFile(
  1. String projectPath, {
  2. DevDiscoveryStore store = const FileDevDiscoveryStore(),
})

Reads the session discovery file: null when absent (no live session); FormatException when the file exists but is unreadable or carries an unknown schema (readers reject unknown schema values).

Implementation

DevSessionDiscovery? readRunnerSessionFile(
  String projectPath, {
  DevDiscoveryStore store = const FileDevDiscoveryStore(),
}) {
  final record = store.readRunnerSession(projectPath);
  if (record == null) return null;
  return DevSessionDiscovery(
    vmServiceUri: record.vmServiceUri,
    controlPort: record.controlPort,
    deviceId: record.deviceId,
    pid: record.pid,
    startedAt: record.startedAt,
  );
}