Skip to content

Commit c798bae

Browse files
committed
[3.12] 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 0dc6d8a commit c798bae

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
@@ -270,8 +270,14 @@ def run_testbed(
270270
update_test_plan(location, platform, args)
271271
print(" done.")
272272

273+
# xcodebuild doesn't guarantee that the CoreSimulatorService daemon is
274+
# running prior to using a simulator, but calling `xcrun simctl list` does.
275+
# Determining the default simulator that *would* be used is a cheap action;
276+
# so use that as a way to ensure that the CoreSimulatorService daemon is
277+
# running.
278+
default_simulator = select_simulator_device(platform)
273279
if simulator is None:
274-
simulator = select_simulator_device(platform)
280+
simulator = default_simulator
275281
print(f"Running test on {simulator}")
276282

277283
xcode_test(

0 commit comments

Comments
 (0)