|
2 | 2 | #
|
3 | 3 | # This source file is part of the Swift.org open source project
|
4 | 4 | #
|
5 |
| -# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors |
| 5 | +# Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors |
6 | 6 | # Licensed under Apache License v2.0 with Runtime Library Exception
|
7 | 7 | #
|
8 | 8 | # See https://swift.org/LICENSE.txt for license information
|
@@ -81,12 +81,16 @@ def darwin_get_watchos_sim_vers():
|
81 | 81 | return [float(v.strip('watchOS')) for v in watchos_version_str]
|
82 | 82 |
|
83 | 83 | # Returns the "prefix" command that should be prepended to the command line to
|
84 |
| -# run an executable compiled for iOS or AppleTV simulator. |
85 |
| -def get_simulator_command(run_os, run_cpu, sdk_path): |
86 |
| - (name, vers, build) = darwin_get_sdk_version(sdk_path) |
| 84 | +# run an executable compiled for an iOS, tvOS, or watchOS simulator. |
| 85 | +def get_simulator_command(run_os, run_cpu): |
| 86 | + mac_ver_tuple = tuple(int(v) for v in |
| 87 | + platform.mac_ver()[0].replace('.', ' ').split()) |
87 | 88 | if run_os == 'ios':
|
88 | 89 | if run_cpu == "i386":
|
89 |
| - if min(darwin_get_ios_sim_vers()) > 10.3: |
| 90 | + if mac_ver_tuple >= (11,): |
| 91 | + print("ERROR: The 32-bit iOS simulator is unavailable on macOS 11.0+") |
| 92 | + sys.exit(1) |
| 93 | + elif min(darwin_get_ios_sim_vers()) > 10.3: |
90 | 94 | print("ERROR: Your system does not have a 32-bit iOS simulator installed.")
|
91 | 95 | print("INFO: 1. Install iOS 10.3 or older simulator (Xcode -> Preferences -> Components -> Simulators).")
|
92 | 96 | print("INFO: 2. Create a 32-bit iPhone 5 device. Run:")
|
@@ -1012,7 +1016,7 @@ if run_vendor == 'apple':
|
1012 | 1016 | # segmentation faults)
|
1013 | 1017 | config.target_run = (
|
1014 | 1018 | "%s %s " %
|
1015 |
| - (xcrun_prefix, get_simulator_command(run_os, run_cpu, config.variant_sdk))) |
| 1019 | + (xcrun_prefix, get_simulator_command(run_os, run_cpu))) |
1016 | 1020 |
|
1017 | 1021 | (sw_vers_name, sw_vers_vers, sw_vers_build) = \
|
1018 | 1022 | darwin_get_sdk_version(config.variant_sdk)
|
|
0 commit comments