Changeset 217147 in webkit


Ignore:
Timestamp:
May 19, 2017, 1:47:44 PM (8 years ago)
Author:
Jonathan Bedard
Message:

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.

Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r217136 r217147  
     12017-05-19  Jonathan Bedard  <jbedard@apple.com>
     2
     3        webkitpy: Use simctl boot to run multiple simulators at once
     4        https://bugs.webkit.org/show_bug.cgi?id=172374
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        * Scripts/webkitpy/common/system/platforminfo.py:
     9        (PlatformInfo.xcode_version): Return the current version of Xcode.
     10        * Scripts/webkitpy/common/system/platforminfo_mock.py:
     11        (MockPlatformInfo.xcode_version): Return version 8.0 for testing.
     12        * Scripts/webkitpy/port/ios_simulator.py:
     13        (IOSSimulatorPort.use_multiple_simulator_apps): Return true if we need to
     14        run multiple Simulator.app instances.
     15        (IOSSimulatorPort._create_simulators): Only copy the simulator app for older
     16        versions of Xcode.
     17        (IOSSimulatorPort._create_devices): Use 'simctl boot' directly unless using
     18        an older version of Xcode.
     19
    1202017-05-19  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py

    r202362 r217147  
    134134        return (line for line in output.splitlines())
    135135
     136    def xcode_version(self):
     137        if not self.is_mac():
     138            raise NotImplementedError
     139        return self._executive.run_command(['xcodebuild', '-version']).split()[1]
     140
    136141    def _determine_os_name(self, sys_platform):
    137142        if sys_platform == 'darwin':
  • trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py

    r179788 r217147  
    6161        return '8.1'
    6262
     63    def xcode_version(self):
     64        return '8.0'
     65
    6366    def xcode_simctl_list(self):
    6467        return self.expected_xcode_simctl_list
  • trunk/Tools/Scripts/webkitpy/port/ios_simulator.py

    r216776 r217147  
    171171                _log.warning('Unable to remove Simulator' + str(i))
    172172
     173    def use_multiple_simulator_apps(self):
     174        return int(self.host.platform.xcode_version().split('.')[0]) < 9
     175
    173176    def _create_simulators(self):
    174177        if (self.default_child_processes() < self.child_processes()):
     
    179182        if self._using_dedicated_simulators():
    180183            atexit.register(lambda: self._teardown_managed_simulators())
    181             self._createSimulatorApps()
     184
     185            if self.use_multiple_simulator_apps():
     186                self._createSimulatorApps()
    182187
    183188            for i in xrange(self.child_processes()):
     
    212217
    213218            # FIXME: <rdar://problem/20916140> Switch to using CoreSimulator.framework for launching and quitting iOS Simulator
    214             self._executive.run_command([
    215                 'open', '-g', '-b', self.SIMULATOR_BUNDLE_ID + str(i),
    216                 '--args', '-CurrentDeviceUDID', device_udid])
     219            if self.use_multiple_simulator_apps():
     220                self._executive.run_command([
     221                    'open', '-g', '-b', self.SIMULATOR_BUNDLE_ID + str(i),
     222                    '--args', '-CurrentDeviceUDID', device_udid])
     223            else:
     224                self._executive.run_command(['xcrun', 'simctl', 'boot', device_udid])
    217225
    218226            if mac_os_version in ['elcapitan', 'yosemite', 'mavericks']:
    219227                time.sleep(2.5)
     228
     229        if not self.use_multiple_simulator_apps():
     230            self._executive.run_command(['open', '-g', '-b', self.SIMULATOR_BUNDLE_ID])
    220231
    221232        _log.info('Waiting for all iOS Simulators to finish booting.')
    222233        for i in xrange(self.child_processes()):
    223234            Simulator.wait_until_device_is_booted(Simulator.managed_devices[i].udid)
     235        _log.info('All simulators have booted.')
    224236
    225237        IOSSimulatorPort._DEVICE_MAP = {}
Note: See TracChangeset for help on using the changeset viewer.