Skip to content

Commit 67886fb

Browse files
committed
[3.11] pythongh-153631: Ensure iOS simulator is running before starting build (pythonGH-153632) (python#153675)
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)
1 parent 975e59a commit 67886fb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎Apple/testbed/__main__.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,14 @@ def run_testbed(
284284
update_test_plan(location, platform, args)
285285
print(" done.")
286286

287+
# xcodebuild doesn't guarantee that the CoreSimulatorService daemon is
288+
# running prior to using a simulator, but calling `xcrun simctl list` does.
289+
# Determining the default simulator that *would* be used is a cheap action;
290+
# so use that as a way to ensure that the CoreSimulatorService daemon is
291+
# running.
292+
default_simulator = select_simulator_device(platform)
287293
if simulator is None:
288-
simulator = select_simulator_device(platform)
294+
simulator = default_simulator
289295
print(f"Running test on {simulator}")
290296

291297
xcode_test(

0 commit comments

Comments
 (0)