Title: [291300] trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py
Revision
291300
Author
[email protected]
Date
2022-03-15 10:14:54 -0700 (Tue, 15 Mar 2022)

Log Message

[webkitpy] Make SimulatedDevice.is_usable check more robust
https://bugs.webkit.org/show_bug.cgi?id=237795

Reviewed by Jonathan Bedard.

Rather than searching for the service name in the output of `launchctl list`,
pass in the name as an additional argument so that it prints out information
about that particular service. I have verified that this works in local testing
for both iOS and watchOS simulators.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice):
(SimulatedDevice.is_usable):

Canonical link: https://commits.webkit.org/248439@main

Modified Paths

Diff

Modified: trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py (291299 => 291300)


--- trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py	2022-03-15 17:06:49 UTC (rev 291299)
+++ trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py	2022-03-15 17:14:54 UTC (rev 291300)
@@ -540,8 +540,8 @@
     ]
 
     UI_MANAGER_SERVICE = {
-        'iOS': 'com.apple.springboard.services',
-        'watchOS': 'com.apple.carousel.sessionservice',
+        'iOS': 'com.apple.SpringBoard',
+        'watchOS': 'com.apple.Carousel',
     }
 
     def __init__(self, name, udid, host, device_type, build_version):
@@ -596,8 +596,8 @@
             _log.debug(u'{} has no service to check if the device is usable'.format(self.device_type.software_variant))
             return True
 
-        system_processes = self.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'spawn', self.udid, 'launchctl', 'print', 'system'], decode_output=True, return_stderr=False)
-        if re.search(r'"{}"'.format(service), system_processes) or re.search(r'A\s+{}'.format(service), system_processes):
+        exit_code = self.executive.run_command([SimulatedDeviceManager.xcrun, 'simctl', 'spawn', self.udid, 'launchctl', 'list', service], return_exit_code=True)
+        if exit_code == 0:
             return True
         return False
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to