+2017-05-19 Jonathan Bedard <jbedard@apple.com>
+
+ webkitpy: Use simctl boot to run multiple simulators at once
+ https://bugs.webkit.org/show_bug.cgi?id=172374
+
+ Reviewed by Alexey Proskuryakov.
+
+ * Scripts/webkitpy/common/system/platforminfo.py:
+ (PlatformInfo.xcode_version): Return the current version of Xcode.
+ * Scripts/webkitpy/common/system/platforminfo_mock.py:
+ (MockPlatformInfo.xcode_version): Return version 8.0 for testing.
+ * Scripts/webkitpy/port/ios_simulator.py:
+ (IOSSimulatorPort.use_multiple_simulator_apps): Return true if we need to
+ run multiple Simulator.app instances.
+ (IOSSimulatorPort._create_simulators): Only copy the simulator app for older
+ versions of Xcode.
+ (IOSSimulatorPort._create_devices): Use 'simctl boot' directly unless using
+ an older version of Xcode.
+
2017-05-19 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, fix the build on the latest internal SDK.
output = self._executive.run_command(['xcrun', 'simctl', 'list'], return_stderr=False)
return (line for line in output.splitlines())
+ def xcode_version(self):
+ if not self.is_mac():
+ raise NotImplementedError
+ return self._executive.run_command(['xcodebuild', '-version']).split()[1]
+
def _determine_os_name(self, sys_platform):
if sys_platform == 'darwin':
return 'mac'
except:
_log.warning('Unable to remove Simulator' + str(i))
+ def use_multiple_simulator_apps(self):
+ return int(self.host.platform.xcode_version().split('.')[0]) < 9
+
def _create_simulators(self):
if (self.default_child_processes() < self.child_processes()):
_log.warn('You have specified very high value({0}) for --child-processes'.format(self.child_processes()))
if self._using_dedicated_simulators():
atexit.register(lambda: self._teardown_managed_simulators())
- self._createSimulatorApps()
+
+ if self.use_multiple_simulator_apps():
+ self._createSimulatorApps()
for i in xrange(self.child_processes()):
self._create_device(i)
_log.debug('testing device %s has udid %s', i, device_udid)
# FIXME: <rdar://problem/20916140> Switch to using CoreSimulator.framework for launching and quitting iOS Simulator
- self._executive.run_command([
- 'open', '-g', '-b', self.SIMULATOR_BUNDLE_ID + str(i),
- '--args', '-CurrentDeviceUDID', device_udid])
+ if self.use_multiple_simulator_apps():
+ self._executive.run_command([
+ 'open', '-g', '-b', self.SIMULATOR_BUNDLE_ID + str(i),
+ '--args', '-CurrentDeviceUDID', device_udid])
+ else:
+ self._executive.run_command(['xcrun', 'simctl', 'boot', device_udid])
if mac_os_version in ['elcapitan', 'yosemite', 'mavericks']:
time.sleep(2.5)
+ if not self.use_multiple_simulator_apps():
+ self._executive.run_command(['open', '-g', '-b', self.SIMULATOR_BUNDLE_ID])
+
_log.info('Waiting for all iOS Simulators to finish booting.')
for i in xrange(self.child_processes()):
Simulator.wait_until_device_is_booted(Simulator.managed_devices[i].udid)
+ _log.info('All simulators have booted.')
IOSSimulatorPort._DEVICE_MAP = {}
for i in xrange(self.child_processes()):