iOS simulator testing: replace `simctl bootstatus` with boot+shutdown
authorJulian Lettner <julian.lettner@apple.com>
Thu, 2 Apr 2020 19:58:47 +0000 (12:58 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Thu, 2 Apr 2020 21:45:54 +0000 (14:45 -0700)
rdar://59643443

compiler-rt/test/sanitizer_common/ios_commands/iossim_prepare.py

index 1a35000..0cfec6b 100755 (executable)
@@ -9,8 +9,9 @@ device_id = os.environ.get('SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER')
 if not device_id:
     raise EnvironmentError('Specify SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER to select which simulator to use.')
 
-boot_cmd = ['xcrun', 'simctl', 'bootstatus', device_id, '-b']
-subprocess.check_call(boot_cmd)
+DEVNULL = open(os.devnull, 'w')
+subprocess.call(['xcrun', 'simctl', 'shutdown', device_id], stderr=DEVNULL)
+subprocess.check_call(['xcrun', 'simctl', 'boot', device_id])
 # TODO(rdar58118442): we start the simulator here, but we never tear it down