mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
iOS Sim: Wire in launch arguments to simctl
This commit is contained in:
parent
c47775fb72
commit
26b657019d
@ -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 {
|
|||||||
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 {
|
|||||||
// 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');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user