diff --git a/tools/engine_tool/lib/src/commands/run_command.dart b/tools/engine_tool/lib/src/commands/run_command.dart index 0b59ff99c4f6a..2864329ef6463 100644 --- a/tools/engine_tool/lib/src/commands/run_command.dart +++ b/tools/engine_tool/lib/src/commands/run_command.dart @@ -8,6 +8,7 @@ import 'package:engine_build_configs/engine_build_configs.dart'; import 'package:process_runner/process_runner.dart'; import '../build_utils.dart'; +import '../label.dart'; import '../run_utils.dart'; import 'command.dart'; import 'flags.dart'; @@ -112,14 +113,15 @@ See `flutter run --help` for a listing return mode; } + late final Future _runTarget = + detectAndSelectRunTarget(environment, _getDeviceId()); + Future _selectTargetConfig() async { final String configName = argResults![configFlag] as String; if (configName.isNotEmpty) { return demangleConfigName(environment, configName); } - final String deviceId = _getDeviceId(); - final RunTarget? target = - await detectAndSelectRunTarget(environment, deviceId); + final RunTarget? target = await _runTarget; if (target == null) { return demangleConfigName(environment, 'host_debug'); } @@ -158,6 +160,9 @@ See `flutter run --help` for a listing final List extraGnArgs = [ if (!useRbe) '--no-rbe', ]; + final RunTarget? target = await _runTarget; + final List