Commit 26b65701 authored by Chinmay Garde's avatar Chinmay Garde

iOS Sim: Wire in launch arguments to simctl

parent c47775fb
...@@ -19,6 +19,7 @@ import 'simulator.dart'; ...@@ -19,6 +19,7 @@ import 'simulator.dart';
const String _ideviceinstallerInstructions = const String _ideviceinstallerInstructions =
'To work with iOS devices, please install ideviceinstaller.\n' 'To work with iOS devices, please install ideviceinstaller.\n'
'If you use homebrew, you can install it with "\$ brew install ideviceinstaller".'; 'If you use homebrew, you can install it with "\$ brew install ideviceinstaller".';
const String _flutterToolsFlagPrefix = "flutter_tools_";
class IOSDeviceDiscovery extends DeviceDiscovery { class IOSDeviceDiscovery extends DeviceDiscovery {
List<Device> _devices = <Device>[]; List<Device> _devices = <Device>[];
...@@ -303,8 +304,7 @@ class IOSSimulator extends Device { ...@@ -303,8 +304,7 @@ class IOSSimulator extends Device {
int debugPort: observatoryDefaultPort, int debugPort: observatoryDefaultPort,
Map<String, dynamic> platformArgs Map<String, dynamic> platformArgs
}) async { }) async {
// TODO(chinmaygarde): Use checked, mainPath, route. // TODO(chinmaygarde): Use mainPath, route.
// TODO(devoncarew): Handle startPaused, debugPort.
printTrace('Building ${app.name} for $id'); printTrace('Building ${app.name} for $id');
if (clearLogs) if (clearLogs)
...@@ -328,8 +328,23 @@ class IOSSimulator extends Device { ...@@ -328,8 +328,23 @@ class IOSSimulator extends Device {
// Step 3: Install the updated bundle to the simulator // Step 3: Install the updated bundle to the simulator
SimControl.install(id, path.absolute(bundle.path)); SimControl.install(id, path.absolute(bundle.path));
// Step 4: Launch the updated application in the simulator // Step 4: Prepare launch arguments
SimControl.launch(id, app.id); List<String> args = [];
if (checked) {
args.add("--${_flutterToolsFlagPrefix}checked");
}
if (startPaused) {
args.add("--${_flutterToolsFlagPrefix}startPaused");
}
if (debugPort != observatoryDefaultPort) {
args.add("--${_flutterToolsFlagPrefix}debugPort=$debugPort");
}
// Step 5: Launch the updated application in the simulator
SimControl.launch(id, app.id, args);
printTrace('Successfully started ${app.name} on $id'); printTrace('Successfully started ${app.name} on $id');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment