Commit 1bc54e06 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Eliminate dead iOS device mock code (#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.
parent 747e25e8
...@@ -96,20 +96,20 @@ class IOSDevice extends Device { ...@@ -96,20 +96,20 @@ class IOSDevice extends Device {
@override @override
bool get supportsStartPaused => false; bool get supportsStartPaused => false;
static List<IOSDevice> getAttachedDevices([IOSDevice mockIOS]) { static List<IOSDevice> getAttachedDevices() {
if (!doctor.iosWorkflow.hasIDeviceId) if (!doctor.iosWorkflow.hasIDeviceId)
return <IOSDevice>[]; return <IOSDevice>[];
final List<IOSDevice> devices = <IOSDevice>[]; final List<IOSDevice> devices = <IOSDevice>[];
for (String id in _getAttachedDeviceIDs(mockIOS)) { for (String id in _getAttachedDeviceIDs()) {
final String name = IOSDevice._getDeviceInfo(id, 'DeviceName', mockIOS); final String name = IOSDevice._getDeviceInfo(id, 'DeviceName');
devices.add(new IOSDevice(id, name: name)); devices.add(new IOSDevice(id, name: name));
} }
return devices; return devices;
} }
static Iterable<String> _getAttachedDeviceIDs([IOSDevice mockIOS]) { static Iterable<String> _getAttachedDeviceIDs() {
final String listerPath = (mockIOS != null) ? mockIOS.listerPath : _checkForCommand('idevice_id'); final String listerPath = _checkForCommand('idevice_id');
try { try {
final String output = runSync(<String>[listerPath, '-l']); final String output = runSync(<String>[listerPath, '-l']);
return output.trim().split('\n').where((String s) => s != null && s.isNotEmpty); return output.trim().split('\n').where((String s) => s != null && s.isNotEmpty);
...@@ -118,10 +118,8 @@ class IOSDevice extends Device { ...@@ -118,10 +118,8 @@ class IOSDevice extends Device {
} }
} }
static String _getDeviceInfo(String deviceID, String infoKey, [IOSDevice mockIOS]) { static String _getDeviceInfo(String deviceID, String infoKey) {
final String informerPath = (mockIOS != null) final String informerPath = _checkForCommand('ideviceinfo');
? mockIOS.informerPath
: _checkForCommand('ideviceinfo');
return runSync(<String>[informerPath, '-k', infoKey, '-u', deviceID]).trim(); return runSync(<String>[informerPath, '-k', infoKey, '-u', deviceID]).trim();
} }
......
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