diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 59243f68b20..5b9bad2c836 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -222,7 +222,7 @@ class FlutterDevice { int ddsPort, bool disableServiceAuthCodes = false, bool disableDds = false, - bool allowExistingDdsInstance = false, + @required bool allowExistingDdsInstance, bool ipv6 = false, }) { final Completer completer = Completer(); @@ -1217,7 +1217,7 @@ abstract class ResidentRunner { Restart restart, CompileExpression compileExpression, GetSkSLMethod getSkSLMethod, - bool allowExistingDdsInstance, + @required bool allowExistingDdsInstance, }) async { if (!debuggingOptions.debuggingEnabled) { throw 'The service protocol is not enabled.'; diff --git a/packages/flutter_tools/lib/src/run_cold.dart b/packages/flutter_tools/lib/src/run_cold.dart index 8410f8ede2b..75fdc72d8e2 100644 --- a/packages/flutter_tools/lib/src/run_cold.dart +++ b/packages/flutter_tools/lib/src/run_cold.dart @@ -73,7 +73,9 @@ class ColdRunner extends ResidentRunner { if (debuggingOptions.debuggingEnabled) { try { await Future.wait(>[ - connectToServiceProtocol(), + connectToServiceProtocol( + allowExistingDdsInstance: false, + ), serveDevToolsGracefully( devToolsServerAddress: debuggingOptions.devToolsServerAddress, ), diff --git a/packages/flutter_tools/test/general.shard/resident_runner_test.dart b/packages/flutter_tools/test/general.shard/resident_runner_test.dart index 91d4c585b65..3166445d6eb 100644 --- a/packages/flutter_tools/test/general.shard/resident_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_runner_test.dart @@ -197,6 +197,7 @@ void main() { restart: anyNamed('restart'), compileExpression: anyNamed('compileExpression'), getSkSLMethod: anyNamed('getSkSLMethod'), + allowExistingDdsInstance: anyNamed('allowExistingDdsInstance'), )).thenAnswer((Invocation invocation) async { }); when(mockFlutterDevice.setupDevFS(any, any)) .thenAnswer((Invocation invocation) async { @@ -2815,7 +2816,7 @@ void main() { observatoryUris: Stream.value(testUri), ); - await flutterDevice.connect(); + await flutterDevice.connect(allowExistingDdsInstance: true); verify(mockLogReader.connectedVMService = mockVMService); }, overrides: { VMServiceConnector: () => (Uri httpUri, {