Skip to content

Commit c8febd9

Browse files
committed
Clarify already-booted comment in boot_simulator
1 parent 53206bf commit c8febd9

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

apple/internal/templates/apple_simulator.template.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,13 @@ def boot_simulator(*, developer_path: str, simctl_path: str, udid: str) -> None:
472472
try:
473473
subprocess.run([simctl_path, "boot", udid], check=True)
474474
except subprocess.CalledProcessError as e:
475-
# When reusing a simulator we may hit "Unable to boot device in current
476-
# state: Booted", which exits 149. That is the expected no-op here. Mirror
477-
# the test runner's simulator_creator.py: treat 149 as success only after
478-
# confirming the device really is booted, so a stuck device (e.g. "Shutting
479-
# Down", which also exits 149) still fails loudly.
475+
# `simctl boot` errors out if the device is already booted, exiting 149
476+
# with "Unable to boot device in current state: Booted". Since our goal is
477+
# simply for the device to be booted, that case is already satisfied and we
478+
# can carry on. But 149 is not unique to "already booted" -- other states
479+
# like "Shutting Down" report it too -- so, as simulator_creator.py does, we
480+
# only ignore it after confirming via `simctl list` that the device really
481+
# is booted. Every other failure propagates.
480482
already_booted = False
481483
if e.returncode == 149:
482484
list_result = subprocess.run(

0 commit comments

Comments
 (0)