Skip to content

Commit 901e496

Browse files
committed
Merge branch 'main' into update-readme
2 parents 7198092 + 7167c94 commit 901e496

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

Examples/Showcase/Showcase.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@
327327
INFOPLIST_KEY_UILaunchStoryboardName = "";
328328
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
329329
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
330+
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
330331
LD_RUNPATH_SEARCH_PATHS = (
331332
"$(inherited)",
332333
"@executable_path/Frameworks",
@@ -361,6 +362,7 @@
361362
INFOPLIST_KEY_UILaunchStoryboardName = "";
362363
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
363364
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
365+
INFOPLIST_KEY_UIUserInterfaceStyle = Light;
364366
LD_RUNPATH_SEARCH_PATHS = (
365367
"$(inherited)",
366368
"@executable_path/Frameworks",

Examples/Showcase/Showcase/App.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SwiftUI
44
struct App: SwiftUI.App {
55
var body: some Scene {
66
WindowGroup {
7-
AppView().preferredColorScheme(.light)
7+
AppView()
88
}
99
}
1010
}

Examples/Showcase/Showcase/AppView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ struct ContentView: View {
6666
}
6767

6868
#Preview {
69-
AppView().preferredColorScheme(.light)
69+
AppView()
7070
}

fastlane/Fastfile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ skip_docs
22

33
devices = {
44
"ios" => {
5-
15 => ["iPhone SE (3rd generation) (15.5)", "iPad Air (5th generation) (15.5)",],
5+
15 => ["iPhone 13 Pro (15.5)", "iPad Pro (11-inch) (3rd generation) (15.5)",],
66
16 => ["iPhone 14 Pro (16.4)", "iPad Pro (11-inch) (4th generation) (16.4)"],
77
17 => ["iPhone 15 Pro (17.5)", "iPad Pro 11-inch (M4) (17.5)"],
88
18 => ["iPhone 16 Pro (18.6)", "iPad Pro 11-inch (M4) (18.6)"],
@@ -48,20 +48,27 @@ lane :create_simulators do |options|
4848

4949
# Build lookup tables from CoreSimulator for robust name→identifier mapping
5050
begin
51+
# Build a set of existing simulator name+runtime pairs to prevent duplicates across OS versions
52+
devices_json = sh("xcrun simctl list -j devices", log: false)
53+
devices_list = JSON.parse(devices_json)
54+
existing_pairs = Set.new
55+
(devices_list["devices"] || {}).each do |runtime_key, arr|
56+
Array(arr).each do |d|
57+
name = d["name"]
58+
next unless name && runtime_key
59+
existing_pairs.add("#{name}||#{runtime_key}")
60+
end
61+
end
62+
5163
list_json = sh("xcrun simctl list -j", log: false)
5264
list = JSON.parse(list_json)
5365
devtypes = list["devicetypes"] || []
5466
runtimes = list["runtimes"] || []
55-
56-
# Build a set of existing simulator names to prevent duplicates
57-
devices_json = sh("xcrun simctl list -j devices", log: false)
58-
devices_list = JSON.parse(devices_json)
59-
existing_names = (devices_list["devices"] || {}).values.flatten.map { |d| d["name"] }.compact.to_set
6067
rescue => e
6168
UI.message("Failed to read simctl lists: #{e}")
6269
devtypes = []
6370
runtimes = []
64-
existing_names = Set.new
71+
existing_pairs = Set.new
6572
end
6673

6774
device_name_to_id = devtypes.each_with_object({}) do |dt, h|
@@ -126,13 +133,14 @@ lane :create_simulators do |options|
126133
# Use the device name without the version suffix as the simulator name
127134
sim_name = device_name
128135

129-
if existing_names.include?(sim_name)
136+
pair_key = "#{sim_name}||#{runtime_id}"
137+
if existing_pairs.include?(pair_key)
130138
UI.message("Already exists: #{sim_name} (#{runtime_version}), skipping")
131139
next
132140
end
133141

134142
sh(%(xcrun simctl create "#{sim_name}" "#{device_type_id}" "#{runtime_id}" || true))
135-
existing_names.add(sim_name)
143+
existing_pairs.add(pair_key)
136144
rescue => e
137145
UI.message("Skipping #{descriptor}: #{e}")
138146
end

0 commit comments

Comments
 (0)