Skip to content

Commit d1783db

Browse files
author
Julian Lettner
committed
[iOS sim] Ensure simulator device is booted in iossim_prepare.py
Recent versions of the iOS simulator require that a "simulator device" is booted before we can use `simctl spawn` (see iossim_run.py) to start processes. We can use `simctl bootstatus` to ensure that the simulator device is booted before we run any tests via lit. The `-b` option starts the device if necessary. Reviewed By: delcypher Differential Revision: https://reviews.llvm.org/D71449
1 parent 0378f3a commit d1783db

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#!/usr/bin/python
22

3-
import os, sys, subprocess, json
3+
import json
4+
import os
5+
import subprocess
6+
7+
8+
device_id = os.environ.get('SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER')
9+
if not device_id:
10+
raise EnvironmentError('Specify SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER to select which simulator to use.')
11+
12+
boot_cmd = ['xcrun', 'simctl', 'bootstatus', device_id, '-b']
13+
subprocess.check_call(boot_cmd)
14+
# TODO(rdar58118442): we start the simulator here, but we never tear it down
15+
416

517
print(json.dumps({"env": {}}))

0 commit comments

Comments
 (0)