Skip to content

Commit 1bc54e0

Browse files
authored
Eliminate dead iOS device mock code (flutter#10732)
This code is unused in any test. In upcoming changes that migrate to Xcode instruments based device listing, we'll mock out the instruments output separately.
1 parent 747e25e commit 1bc54e0

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

packages/flutter_tools/lib/src/ios/devices.dart

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,20 @@ class IOSDevice extends Device {
9696
@override
9797
bool get supportsStartPaused => false;
9898

99-
static List<IOSDevice> getAttachedDevices([IOSDevice mockIOS]) {
99+
static List<IOSDevice> getAttachedDevices() {
100100
if (!doctor.iosWorkflow.hasIDeviceId)
101101
return <IOSDevice>[];
102102

103103
final List<IOSDevice> devices = <IOSDevice>[];
104-
for (String id in _getAttachedDeviceIDs(mockIOS)) {
105-
final String name = IOSDevice._getDeviceInfo(id, 'DeviceName', mockIOS);
104+
for (String id in _getAttachedDeviceIDs()) {
105+
final String name = IOSDevice._getDeviceInfo(id, 'DeviceName');
106106
devices.add(new IOSDevice(id, name: name));
107107
}
108108
return devices;
109109
}
110110

111-
static Iterable<String> _getAttachedDeviceIDs([IOSDevice mockIOS]) {
112-
final String listerPath = (mockIOS != null) ? mockIOS.listerPath : _checkForCommand('idevice_id');
111+
static Iterable<String> _getAttachedDeviceIDs() {
112+
final String listerPath = _checkForCommand('idevice_id');
113113
try {
114114
final String output = runSync(<String>[listerPath, '-l']);
115115
return output.trim().split('\n').where((String s) => s != null && s.isNotEmpty);
@@ -118,10 +118,8 @@ class IOSDevice extends Device {
118118
}
119119
}
120120

121-
static String _getDeviceInfo(String deviceID, String infoKey, [IOSDevice mockIOS]) {
122-
final String informerPath = (mockIOS != null)
123-
? mockIOS.informerPath
124-
: _checkForCommand('ideviceinfo');
121+
static String _getDeviceInfo(String deviceID, String infoKey) {
122+
final String informerPath = _checkForCommand('ideviceinfo');
125123
return runSync(<String>[informerPath, '-k', infoKey, '-u', deviceID]).trim();
126124
}
127125

0 commit comments

Comments
 (0)