Skip to content

Commit 21c72f9

Browse files
committed
[3.13] gh-153631: Ensure iOS simulator is running before starting build (GH-153632)
Makes a small change to the iOS build script to improve build stability. xcodebuild doesn't guarantee that the CoreSimulatorService is running before starting a simulator. If the service isn't running, xcodebuild reports that no simulators are available, and fails to start the test app. However, simctl blocks until the simulator is available, and simctl is used to evaluate the default simulator. So - the iOS build script now unconditionally determines the default simulator, even if a specific simulator is requested. (cherry picked from commit 2dc1a91) Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
1 parent cd1d07a commit 21c72f9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

iOS/testbed/__main__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,14 @@ def run_testbed(simulator: str | None, args: list[str], verbose: bool = False):
220220
update_test_plan(location, args)
221221
print(" done.")
222222

223+
# xcodebuild doesn't guarantee that the CoreSimulatorService daemon is
224+
# running prior to using a simulator, but calling `xcrun simctl list` does.
225+
# Determining the default simulator that *would* be used is a cheap action;
226+
# so use that as a way to ensure that the CoreSimulatorService daemon is
227+
# running.
228+
default_simulator = select_simulator_device()
223229
if simulator is None:
224-
simulator = select_simulator_device()
230+
simulator = default_simulator
225231
print(f"Running test on {simulator}")
226232

227233
xcode_test(location, simulator=simulator, verbose=verbose)

0 commit comments

Comments
 (0)