Run a virtual iPhone on an Apple Silicon Mac.
Swift
Offer iOS 26.4 to 26.6 on their own cloudOS
Maximilian Paß15a1a8c86f6a
diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneFirmwareCommand.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneFirmwareCommand.swiftindex 93c5ac7b..bc1749b7 100644--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneFirmwareCommand.swift+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneFirmwareCommand.swift@@ -197,10 +197,18 @@ struct VPhoneFirmwareCatalogCommand: ParsableCommand {print("Firmware catalog (\(entry.productType), \(entry.name))")let os = VPhoneGuestDevice.Family(rawValue: entry.family)?.osName ?? "iOS"let width = max(os.count, entry.pairings.map(\.ios.name.count).max() ?? 0)- print("\(os.padding(toLength: width, withPad: " ", startingAt: 0)) recommended cloudOS")+ let recommendedWidth = max(19, entry.pairings.map(\.recommendedCloudOS.name.count).max() ?? 0)+ let ownColumn = entry.pairings.contains { $0.matchingCloudOS != nil }+ print("\(os.padding(toLength: width, withPad: " ", startingAt: 0)) "+ + "recommended cloudOS".padding(toLength: recommendedWidth, withPad: " ", startingAt: 0)+ + (ownColumn ? " own cloudOS (research board: root, VPHONE_IPSW)" : ""))for e in entry.pairings {let ios = e.ios.name.padding(toLength: width, withPad: " ", startingAt: 0)- print("\(ios) \(e.recommendedCloudOS.name)")+ if let own = e.matchingCloudOS {+ print("\(ios) \(e.recommendedCloudOS.name.padding(toLength: recommendedWidth, withPad: " ", startingAt: 0)) \(own.name)")+ } else {+ print("\(ios) \(e.recommendedCloudOS.name)")+ }}}}diff --git a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swiftindex 68bf4710..df6d1a9b 100644--- a/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift+++ b/VPhoneKit/VPhoneCoreKit/Firmware/VPhoneFirmwareCatalog.swift@@ -28,6 +28,16 @@ public struct VPhoneFirmwarePairing: Sendable, Equatable {}}+public extension VPhoneFirmwarePairing {+ /// The release's own cloudOS, where the research board stands in for+ /// vphone600, or nil when there is none. iPhone only: no other guest has run+ /// on the research board.+ var matchingCloudOS: VPhoneCloudOSOption? {+ guard device == VPhoneFirmwareCatalog.device, let version = iosName.split(separator: " ").last else { return nil }+ return VPhoneFirmwareCatalog.researchBoardCloudOS(forVersion: String(version))+ }+}+// MARK: - VPhoneCloudOSOptionpublic struct VPhoneCloudOSOption: Sendable, Equatable {@@ -94,6 +104,24 @@ public enum VPhoneFirmwareCatalog {static let cloud263 = "https://updates.cdn-apple.com/private-cloud-compute/edc92b58ab7e2f207a6407fd0a0e1a60f7d43bf9d93325bf6d3db3e154ee5525"static let cloud264 = "https://updates.cdn-apple.com/private-cloud-compute/c0ecdb4b310cf5239ab2b248dd3098eec297dc5aa3bbe6ada27273262b0b8b64"+ /// cloudOS releases with only the research board (vresearch101ap). A VM on one+ /// of them runs its own release's kernel, rebuilt with the vphone600 kexts+ /// (FirmwareResearchBoardPatchSet, kernelcache_recipes), which needs root and an+ /// ipsw with `kernel extract --kdk`. They are offered beside the 26.4 beta, which+ /// stays the recommendation: it needs neither.+ public static let researchBoardCloudOS: [(version: String, option: VPhoneCloudOSOption)] = [+ ("26.4", .init(name: "cloudOS 26.4 (23E244)", url: "https://updates.cdn-apple.com/private-cloud-compute/6acb7959507f25a76753f5a08ee39f09671486eb7619367e42dc1869bd779035")),+ ("26.5", .init(name: "cloudOS 26.5 (23F75)", url: "https://updates.cdn-apple.com/private-cloud-compute/602f1132456a1323ac145ea13828c3ca72845259b50f99af1cef8329d5e25748")),+ ("26.6", .init(name: "cloudOS 26.6 (23G71)", url: "https://updates.cdn-apple.com/private-cloud-compute/bdad1f912196b6c5fe9342e0bdee8768c7f5bb366cb0dde007f5c28c5d148042")),+ ("26.7", .init(name: "cloudOS 26.7 (23H20)", url: "https://updates.cdn-apple.com/private-cloud-compute/46960a4703ec9b2a81df524d639ea9fe55b30e04f6cf7e21518c2049659509a7")),+ ]++ /// The research board cloudOS of an iOS release's own major and minor version.+ public static func researchBoardCloudOS(forVersion version: String) -> VPhoneCloudOSOption? {+ let release = version.split(separator: ".").prefix(2).joined(separator: ".")+ return researchBoardCloudOS.first { $0.version == release }?.option+ }+/// The iPhone17,3 pairings, oldest first. Launchpad offers the last one by/// default, so the newest release stays last.public static let pairings: [VPhoneFirmwarePairing] = [@@ -524,6 +552,7 @@ public enum VPhoneFirmwareCatalog {for p in pairings where seen.insert(p.cloudosName).inserted {out.append(VPhoneCloudOSOption(name: p.cloudosName, url: p.cloudosURL))}+ out += researchBoardCloudOS.map(\.option)return out}@@ -542,6 +571,7 @@ public enum VPhoneFirmwareCatalog {files: ota.map { ["\(VPhoneOTARelease.cacheDirectoryName)/\($0.fileName)"] + (base.map { [$0] } ?? []) },),recommendedCloudOS: .init(name: $0.cloudosName, url: $0.cloudosURL),+ matchingCloudOS: $0.matchingCloudOS.map { .init(name: $0.name, url: $0.url) },)}}@@ -586,9 +616,13 @@ public struct VPhoneFirmwareCatalogReport: Codable, Equatable, Sendable {public struct Entry: Codable, Equatable, Sendable {public let ios: Firmwarepublic let recommendedCloudOS: Firmware- public init(ios: Firmware, recommendedCloudOS: Firmware) {+ /// The release's own cloudOS, on the research board, when one exists+ /// (`VPhoneFirmwarePairing.matchingCloudOS`).+ public let matchingCloudOS: Firmware?+ public init(ios: Firmware, recommendedCloudOS: Firmware, matchingCloudOS: Firmware? = nil) {self.ios = iosself.recommendedCloudOS = recommendedCloudOS+ self.matchingCloudOS = matchingCloudOS}}diff --git a/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwareCatalogReportTests.swift b/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwareCatalogReportTests.swiftindex 530d2340..6be298b6 100644--- a/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwareCatalogReportTests.swift+++ b/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwareCatalogReportTests.swift@@ -28,6 +28,26 @@ struct FirmwareCatalogReportTests {#expect(!json.contains("build") && !json.contains("files"))}+ @Test func `iOS 26.4 to 26.6 can also run on their own cloudOS, on the research board`() throws {+ let report = VPhoneFirmwareCatalog.report+ let own = Dictionary(uniqueKeysWithValues: report.pairings.compactMap { entry in+ entry.matchingCloudOS.map { (entry.ios.name, $0.name) }+ })+ #expect(own["iOS 26.4.2"] == "cloudOS 26.4 (23E244)")+ #expect(own["iOS 26.5"] == "cloudOS 26.5 (23F75)")+ #expect(own["iOS 26.6.2"] == "cloudOS 26.6 (23G71)")+ #expect(own["iOS 26.3.1"] == nil && own["iOS 27.0"] == nil)+ // The recommendation stays the 26.4 beta, which needs neither root nor ipsw.+ let ios266 = try #require(report.pairings.first { $0.ios.name == "iOS 26.6" })+ #expect(ios266.recommendedCloudOS.name == "cloudOS 26.4")+ // Only the iPhone has run on the research board.+ let pad = try #require(report.devices.first { $0.family == "iPad" })+ #expect(pad.pairings.allSatisfy { $0.matchingCloudOS == nil })+ // An entry without one encodes as before, so an older Launchpad reads it unchanged.+ let ios27 = try #require(report.pairings.first { $0.ios.name == "iOS 27.0" })+ #expect(try !String(decoding: JSONEncoder().encode(ios27), as: UTF8.self).contains("matchingCloudOS"))+ }+@Test func `lists every curated guest`() {let report = VPhoneFirmwareCatalog.report#expect(report.devices.map(\.productType) == VPhoneGuestDevice.known.map(\.productType))diff --git a/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwarePickerTests.swift b/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwarePickerTests.swiftindex 19b92bcb..fe8e0136 100644--- a/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwarePickerTests.swift+++ b/VPhoneKit/VPhoneCoreKitTests/Firmware/FirmwarePickerTests.swift@@ -24,9 +24,12 @@ struct FirmwarePickerTests {}}- @Test func `cloud OS options are distinct in first seen order`() {+ @Test func `cloud OS options are distinct in first seen order, the research board ones last`() {let opts = VPhoneFirmwareCatalog.cloudOSOptions- #expect(opts.map(\.name) == ["cloudOS 26.1", "cloudOS 26.2", "cloudOS 26.3", "cloudOS 26.4"])+ #expect(opts.map(\.name) == [+ "cloudOS 26.1", "cloudOS 26.2", "cloudOS 26.3", "cloudOS 26.4",+ "cloudOS 26.4 (23E244)", "cloudOS 26.5 (23F75)", "cloudOS 26.6 (23G71)", "cloudOS 26.7 (23H20)",+ ])#expect(Set(opts.map(\.url)).count == opts.count) // no dup URLs}