Run a virtual iPhone on an Apple Silicon Mac.
Swift
Enable BTVC patch for HomePod and Apple TV guests
Guilherme Ramboff29f49fdc45
diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.mdindex 971d2535..08c10a39 100644--- a/Research/0_binary_patch_comparison.md+++ b/Research/0_binary_patch_comparison.md@@ -4234,9 +4234,20 @@ the universal binary), and three patches are new:| Patch | Target | Change || --- | --- | --- || `devicetree-cfw-watch_companion` | an iPhone guest's tree | `/product/watch-companion = 1`, added where the board copy removed a placeholder. vphone600's `syscfg/waco` has no syscfg value on a VM, so iBoot drops it and the phone pairs with no watch. |-| `system-bluetoothd-cfw-btvc_le_connection` | `/System/Library/FeatureFlags/Domain/BluetoothFeatures.plist`, `cfw install`, iOS 26+ | `EnableBTVCLeConnection.Enabled = true`: bluetoothd's virtual LE controller may connect. Reverted from the `.bak` when turned off; blocked for tvOS. |+| `system-bluetoothd-cfw-btvc_le_connection` | `/System/Library/FeatureFlags/Domain/BluetoothFeatures.plist`, `cfw install` / `cfw update-environment`, guest OS 26+ | `EnableBTVCLeConnection.Enabled = true`: bluetoothd's virtual LE controller may connect. Reverted from the `.bak` when turned off; enabled for iPhone, Apple TV HD, Apple TV 4K and HomePod guests. || `filesystem-exp-btvc_le_connection` | the same file in the restore image (`minimal`, `watchos`) | The same flag, written before the seal. |+On 2026-10-26 the Apple TV and HomePod presets also enable the guest BTVC+patch, and their installer admission includes it for both plain-arm64 and+arm64e userlands. The existing OS 26+ applicability and opt-out restoration+remain in place. HomePod mini 27.0 (24J361) and tvOS 27.2 (24K120) ship the+BTVC Bonjour, advertisement and LE connection implementation; the HomePod+connection manager still queries `EnableBTVCLeConnection`. Their original+feature plists omit the entry, which the existing plist patcher can add.+This enables transport testing; HomePod onboarding, Apple TV companion setup+and Home/AirPlay pairing have not been validated. Existing machines need the+updated Core Bundle and `cfw update-environment` while stopped, then a boot.+## iOS 18 guests on the research board (2026-10-21)iOS 18.1 to 18.7.2 run on their own release's research board kernel, rebuiltdiff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swiftindex 6d1d8ad6..93397d8c 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestPatchResolution.swift@@ -22,11 +22,12 @@ import Foundationimport VPhonePatchKitpublic enum FirmwareGuestPatchResolution {- /// TV admits the gigalocker repair, opt-in dyld TPRO compatibility, and- /// vphoned with the launchd cache gate its launchd.plist entry needs.+ /// TV admits the gigalocker repair, opt-in dyld TPRO compatibility, virtual+ /// Bluetooth, and vphoned with the launchd cache gate its launchd.plist entry needs./// Other payloads, cache patches and shell integration need a TV port and/// validation before the installer can select them.public static let tvSupportedGuestPatches: Set<String> = [+ FirmwareGuestSystemPatchSet.virtualBluetooth,"system-seputil-boot-gigalocker_uuid","system-gigalocker-boot-rename",FirmwareGuestSystemPatchSet.tvTPRO,diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swiftindex 7f7f1acf..f881295e 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareGuestSystemPatchSet.swift@@ -171,7 +171,7 @@ public enum FirmwareGuestSystemPatchSet {VPhonePatchDeclaration(identifier: virtualBluetooth,title: "Virtual Bluetooth",- summary: "Turns on the feature flag that lets bluetoothd connect over its virtual controller, which a paired watch and phone talk over.",+ summary: "Turns on the feature flag that lets bluetoothd establish LE connections between guests over its Bonjour virtual controller.",target: .guestFile(path: "/" + CustomFirmwareBluetoothVirtualController.relativePath),applicability: VPhonePatchApplicability(iOSBase: .atLeast(major: 26, minor: 0)),),diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swiftindex 8650397d..182b40ce 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift@@ -236,7 +236,6 @@ public enum FirmwarePatchSetCatalog {public static let tvOSBlockedPatches: Set<String> = [paravirtTask3Patch,FirmwareGuestSystemPatchSet.arm64eX1CacheBootstrap,- FirmwareGuestSystemPatchSet.virtualBluetooth,"dyld-boot-iomfb_force_kern","dyld-boot-iomfb_swapend","dyld-boot-lockdown_mode",diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareBluetoothVirtualControllerTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareBluetoothVirtualControllerTests.swiftindex 2d482293..1c901d0d 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareBluetoothVirtualControllerTests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/CustomFirmware/CustomFirmwareBluetoothVirtualControllerTests.swift@@ -42,4 +42,23 @@ struct CustomFirmwareBluetoothVirtualControllerTests {#expect(plan.isEnabled(FirmwareGuestSystemPatchSet.virtualBluetooth) == !base.hasPrefix("18."))}}++ @Test+ func `TV and HomePod presets enable and admit virtual Bluetooth from OS 26`() throws {+ let identifier = FirmwareGuestSystemPatchSet.virtualBluetooth+ for preset in [FirmwarePatchSetCatalog.tvOSPreset, FirmwarePatchSetCatalog.tvOS4KPreset, FirmwarePatchSetCatalog.homePodMiniPreset] {+ for base in ["18.6", "26.4", "27.0", "27.2"] {+ let plan = try VPhonePatchPlan.resolve(+ preset: preset,+ patchSets: FirmwarePatchSetCatalog.bundled,+ iOSBase: VPhoneVersion(base), cloudOS: VPhoneVersion("26.4"),+ )+ #expect(plan.isEnabled(identifier) == !base.hasPrefix("18."))+ }+ }+ let selection: Set<String> = [identifier]+ #expect(FirmwareGuestPatchResolution.unvalidatedTVGuestPatches(enabled: selection).isEmpty)+ #expect(FirmwareGuestPatchResolution.unvalidatedTVGuestPatches(enabled: selection, arm64eUserland: true).isEmpty)+ #expect(FirmwareGuestPatchResolution.unvalidatedHomePodGuestPatches(enabled: selection).isEmpty)+ }}diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plistindex 8ee386be..5f8f0398 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/homepod-mini.plist@@ -111,7 +111,6 @@<string>system-backboardd-cfw-gyroscope</string><string>system-backboardd-cfw-accelerometer</string><string>system-campo-cfw-entitlements</string>- <string>system-bluetoothd-cfw-btvc_le_connection</string><string>system-debugserver-cfw-install</string><string>system-dyld-boot-arm64e_x1_bootstrap</string><string>system-diskimagesiod-cfw-is_mount_complete</string>diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plistindex 2a6464b6..927ddb95 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist@@ -118,7 +118,6 @@<string>system-apps-cfw-attitude</string><string>system-apps-cfw-signin_sheets</string><string>system-preferences-cfw-followup_groups</string>- <string>system-bluetoothd-cfw-btvc_le_connection</string><string>system-backboardd-cfw-gyroscope</string><string>system-backboardd-cfw-accelerometer</string><string>system-campo-cfw-entitlements</string>diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plistindex 82808152..bbedc0d9 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist@@ -121,7 +121,6 @@<string>system-apps-cfw-attitude</string><string>system-apps-cfw-signin_sheets</string><string>system-preferences-cfw-followup_groups</string>- <string>system-bluetoothd-cfw-btvc_le_connection</string><string>system-backboardd-cfw-gyroscope</string><string>system-backboardd-cfw-accelerometer</string><string>system-campo-cfw-entitlements</string>