removeAdbPortForward static method

Future<void> removeAdbPortForward({
  1. int port = 9090,
})

Remove ADB port forward when stopping the server.

Implementation

static Future<void> removeAdbPortForward({int port = 9090}) async {
  if (kIsWeb) return;
  final adbPath = await _findAdb();
  if (adbPath == null) return;

  try {
    await Process.run(adbPath, ['forward', '--remove', 'tcp:$port']);
  } catch (_) {}
}