Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Drop the icons an iOS 18 guest rendered before it had a GPU

Jacky33d1ba518399
diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.md
index 4c769871..6f52710b 100644
--- a/Research/0_binary_patch_comparison.md
+++ b/Research/0_binary_patch_comparison.md
@@ -6846,3 +6846,10 @@ driver's `DTPlatformVersion` is the iOS release; switching the patch off removes
it. Rules are unit-tested by `make test-ios18-gpu`.
**Validation.** See `Research/Guest/ios18_gpu_transport.md`, "Verified".
+
+**Icon store (2026-11-05).** The guest's IconServices store kept the transparent
+graphic icons it rendered before the transport, so Settings' rows stayed blank.
+`cfw install` writes the marker once, and vphoned (`GuestIconServicesCache`)
+removes the store at startup when it was created before the marker, then stops
+iconservicesagent; the Data volume is out of the host's reach. No Apple binary
+change.
diff --git a/Research/Guest/ios18_gpu_transport.md b/Research/Guest/ios18_gpu_transport.md
index 436de9b4..d0a192a0 100644
--- a/Research/Guest/ios18_gpu_transport.md
+++ b/Research/Guest/ios18_gpu_transport.md
@@ -65,7 +65,17 @@ user client in the process are not.
measured. `cfw install` writes `/usr/lib/vphone-ios18-gpu` only when the
installed driver's `DTPlatformVersion` is the iOS release. A machine prepared
before this change, which still has the 26.1 driver, gets no marker and a note
- to run `fw prepare` again. Switching the patch off removes the marker.
+ to run `fw prepare` again. Switching the patch off removes the marker. The
+ marker is written once, so its creation time says when the guest got a GPU.
+- **Icon store.** Without a GPU, iconservicesagent rendered every graphic icon
+ (an SF Symbol on a colored square, declared as `com.apple.graphic-icon.*` in
+ `MobileCoreTypes.bundle`) fully transparent, stored the result in
+ `systemgroup.com.apple.lsd.iconscache/Library/Caches/com.apple.IconsCache`,
+ and kept serving it: Settings' rows stayed blank after the GPU worked. At
+ startup vphoned removes that store when it was created before the marker and
+ stops the agent (`GuestIconServicesCache`), because the Data volume is out of
+ the host's reach. A machine created with the transport on renders its icons
+ with the GPU from the first boot, so it never drops.
## Retargeting to another pairing
@@ -111,9 +121,17 @@ Open:
(`compilerTargetInfo.shaderVersionMajor >= 2`). That field comes from the
device-info reply, so that call was not translated there. It did not recur in
the next two boots and could not be started on demand. The cause is unknown.
-- cameracaptured aborted once at boot in `MPSLibrary::MPSKey_Compile`
- (`MTLReportFailure`) while prewarming inference. That is a shader compile
- failure under a working device, not seen again.
-- Settings row icons stay blank, as before this change. Not a stale cache:
- with the icon cache moved aside, Settings wrote no new entries. Not yet
- explained.
+- cameracaptured aborts in `MPSLibrary::MPSKey_Compile` (`MTLReportFailure`)
+ while prewarming its matting inference, three to five times in some boots and
+ not at all in others. That is an MPS kernel compile failure under a working
+ device. Not yet explained.
+
+Settings icons (2026-11-05): an icon probe got a non-placeholder, fully
+transparent 87×87 image for `com.apple.graphic-icon.gear` at
+`kISImageDescriptorTableUIName`, while a synchronous render at an unused size
+was correct (system-gray enclosure). With the agent stopped first and the store
+moved aside, the same request rendered and Settings showed every row icon.
+Renaming the store while the agent runs does not work: the agent keeps writing
+into the renamed folder and later deletes it. With the bundle's vphoned the store
+created on 2026-11-04 was dropped at the next boot (new store born 00:59:35 UTC,
+after the marker's 00:37:25), the icons rendered, and a further boot kept it.
diff --git a/VPhoneDaemon/Daemon/GuestIconServicesCache.swift b/VPhoneDaemon/Daemon/GuestIconServicesCache.swift
new file mode 100644
index 00000000..788eb487
--- /dev/null
+++ b/VPhoneDaemon/Daemon/GuestIconServicesCache.swift
@@ -0,0 +1,56 @@
+import Darwin
+import Foundation
+import IcliKit
+
+/// Drops IconServices' icon store when it predates the iOS 18 GPU transport.
+///
+/// An iOS 18 guest on a cloudOS 26.1 kernel had no Metal device before
+/// `system-systemhook-cfw-ios18_gpu_transport`. Without one, iconservicesagent
+/// rendered every graphic icon (an SF Symbol on a colored square, such as each
+/// Settings row's) fully transparent, stored the result, and kept serving it
+/// once the GPU worked: Settings' rows stayed blank. The store is on the Data
+/// volume, which the host cannot mount (see ``GuestMobileGestaltCache``), so
+/// vphoned drops it here.
+///
+/// The rule is about age, as the MobileGestalt cache's is. `cfw install` writes
+/// the transport's marker when it turns the transport on and leaves it alone
+/// afterwards, so a store created before the marker was rendered without a GPU,
+/// and the store rebuilt after a drop is newer. App icons in it are drawn
+/// again on demand.
+///
+/// See Research/Guest/ios18_gpu_transport.md.
+enum GuestIconServicesCache {
+ static let storePath =
+ "/private/var/containers/Shared/SystemGroup/systemgroup.com.apple.lsd.iconscache/Library/Caches/com.apple.IconsCache"
+ static let transportMarker = "/usr/lib/vphone-ios18-gpu"
+ private static let agent = "/System/Library/CoreServices/iconservicesagent"
+
+ static func dropIfOlderThanGPUOnStartup() {
+ guard let marker = birthTime(transportMarker), let store = birthTime(storePath),
+ isEarlier(store, than: marker)
+ else { return }
+ do {
+ try FileManager.default.removeItem(atPath: storePath)
+ } catch {
+ NSLog("vphoned: icon store: cannot remove %@: %@", storePath, error.localizedDescription)
+ return
+ }
+ // A running agent keeps writing into the store it opened; launchd
+ // starts it again for its next client, with a new one.
+ let rows = (try? listProcesses(filter: "iconservices"))?["processes"] as? [[String: Any]] ?? []
+ for row in rows where row["executable"] as? String == agent {
+ if let pid = row["pid"] as? Int { kill(pid_t(pid), SIGTERM) }
+ }
+ NSLog("vphoned: icon store predates the GPU transport, removed it; icons are drawn again")
+ }
+
+ private static func birthTime(_ path: String) -> timespec? {
+ var status = stat()
+ guard lstat(path, &status) == 0 else { return nil }
+ return status.st_birthtimespec
+ }
+
+ private static func isEarlier(_ a: timespec, than b: timespec) -> Bool {
+ a.tv_sec != b.tv_sec ? a.tv_sec < b.tv_sec : a.tv_nsec < b.tv_nsec
+ }
+}
diff --git a/VPhoneDaemon/Daemon/main.swift b/VPhoneDaemon/Daemon/main.swift
index 3bbe72ef..df64453a 100644
--- a/VPhoneDaemon/Daemon/main.swift
+++ b/VPhoneDaemon/Daemon/main.swift
@@ -24,6 +24,8 @@ GuestLockScreenIdle.startOnStartup()
// Before the server, so `/v1/health` reports a drop from its first answer.
GuestMobileGestaltCache.dropIfStaleOnStartup()
GuestMobileGestaltCache.presentAlwaysOnDisplayOnStartup()
+// Settings' row icons rendered before the iOS 18 GPU transport are blank.
+GuestIconServicesCache.dropIfOlderThanGPUOnStartup()
// An iOS 18 screen stays black until backboardd runs without surface compression.
GuestCoreAnimationCompression.applyOnStartup()
// Before audiomxd is asked for sound again; see the type for what it cannot cover.
diff --git a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
index d58e477b..17305ac2 100644
--- a/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
+++ b/VPhoneExecutable/VPhoneCommand/VPhoneCommand/Firmware/VPhoneCustomFirmwareInstaller.swift
@@ -2514,7 +2514,13 @@ struct VPhoneCustomFirmwareInstaller {
print(" [!] \(gpuTransportPatch): the installed GPU driver is for \(driver), not \(version); run fw prepare again to stage the iOS \(VPhonePCCGPUDriver.release(version)) driver")
return
}
- try system.writeFile(gpuTransportMarker, contents: Data("1\n".utf8), mode: 0o644, owner: Self.guestOwner)
+ // Written once: vphoned drops the icons IconServices stored
+ // before this time, when the guest had no GPU.
+ let marker = Data("1\n".utf8)
+ if (try? system.readData(gpuTransportMarker)) != marker {
+ try system.writeFile(gpuTransportMarker, contents: marker, mode: 0o644, owner: Self.guestOwner)
+ print(" [+] \(gpuTransportPatch): on over the iOS \(driver) GPU driver")
+ }
live.insert(gpuTransportPatch)
} else {
try system.removeItem(gpuTransportMarker)