Skip to content

Commit 8486598

Browse files
authored
Simulator: Match name exactly (#2818)
This upstreams one of the remaining changes from sourcekit-bazel-bsp that were not already addressed by @brentleyjones recently. I had cases otherwise where requesting e.g. an iPhone 16 would return an iPhone 16 Pro Max since the prefix technically matches. This changes it so that the names are matched exactly.
1 parent a62b715 commit 8486598

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apple/internal/templates/apple_simulator.template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def discover_best_compatible_simulator(
279279
max_runtime_version = device_type.get("maxRuntimeVersion")
280280
if max_runtime_version and max_runtime_version < minimum_runtime_version:
281281
continue
282-
if sim_device and device_type["name"].casefold().find(sim_device) == -1:
282+
if sim_device and device_type["name"].casefold() != sim_device:
283283
continue
284284
compatible_device_types.append(device_type)
285285
compatible_device_types.sort()

0 commit comments

Comments
 (0)