splitting runtime sim version from the os version

This commit is contained in:
Mauro Romito
2026-04-27 12:24:32 +02:00
committed by Mauro
parent 04202676aa
commit fa801b5791
3 changed files with 16 additions and 17 deletions
+8 -4
View File
@@ -21,7 +21,11 @@ struct RunTests: AsyncParsableCommand {
var device = "iPhone 17"
@Option(help: "The iOS version to use for the simulator runtime (e.g. '26.4').")
var osVersion = "26.4"
var osVersion = "26.4.1"
var runtime: String {
osVersion.split(separator: ".").prefix(2).joined(separator: ".")
}
@Option(help: "Number of times to retry failed tests. Only the failing tests are re-run, not the entire suite.")
var retries = 0
@@ -48,7 +52,7 @@ struct RunTests: AsyncParsableCommand {
}
private var simulatorRuntime: String {
"com.apple.CoreSimulator.SimRuntime.iOS-\(osVersion.replacingOccurrences(of: ".", with: "-"))"
"com.apple.CoreSimulator.SimRuntime.iOS-\(runtime.replacingOccurrences(of: ".", with: "-"))"
}
func run() async throws {
@@ -81,9 +85,9 @@ struct RunTests: AsyncParsableCommand {
private func createSimulatorIfNecessary(name: String, type: String) async throws {
logger.info("Checking for simulator '\(name)'…")
guard let simulators = try await CI.run(.path("/bin/zsh"), ["-cu", "xcrun simctl list devices \"iOS \(osVersion)\" available"],
guard let simulators = try await CI.run(.path("/bin/zsh"), ["-cu", "xcrun simctl list devices \"iOS \(runtime)\" available"],
output: .string(limit: 4096)).standardOutput else {
logger.info("No simulators found for iOS \(osVersion). Creating '\(name)'…")
logger.info("No simulators found for iOS \(runtime). Creating '\(name)'…")
try await createSimulator(name: name, type: type)
return
}