Run a virtual iPhone on an Apple Silicon Mac.
Swift
Fill gaps in the template, clone and service notes
Jacky1cb62d1e95e9
diff --git a/Research/Guest/service_trimming.md b/Research/Guest/service_trimming.mdindex 1d08c74d..708a0a39 100644--- a/Research/Guest/service_trimming.md+++ b/Research/Guest/service_trimming.md@@ -306,3 +306,23 @@ frames, because the iPhone 27.0 guest publishes no synthetic camera(`libvcamcaptured` logs `_sSourceList not located` on every boot, before andafter), so no client can reach the drive; and the microphone, whose code didnot change.++## Open items++- **iPadOS.** vphoned picks the list by major version only, so iPad guests on+ 26 and 27 get the iPhone lists. No iPad guest has been measured with them.+- **WidgetKit control extensions on iOS 26.** The `ControlAction.init(_:)`+ crashes on 2 of 16 trimmed 26.6.2 boots ([iOS 26](#ios-26)) point at a+ disabled job an App Intent reference needs; which one was not found.+- **Location on iOS 27.** Location simulation under the profile is verified+ on 26.6.2 only; on 27.0 it waits for locationd itself to work+ ([locationd startup deadlock](locationd_startup_deadlock.md)).+- **Host memory.** The VM has no balloon device, so the guest's freed memory+ stays with the VM process (8.67 → 7.26 GB on 27.0). Returning it would take+ `VZVirtioTraditionalMemoryBalloonDevice` and a guest that drives it, which+ was not evaluated; giving trimmed machines less memory is the simple way to+ use the headroom.+- **Sample size.** Each configuration's idle figures come from one or two+ 15-minute windows, and bursts of maintenance work that `dasd` schedules+ (mediaanalysisd, cloudd, searchd) dominated some of them. They show the+ direction, not a precise rate.diff --git a/Research/Guest/template_snapshot_deletion.md b/Research/Guest/template_snapshot_deletion.mdindex d82cd38d..102c3732 100644--- a/Research/Guest/template_snapshot_deletion.md+++ b/Research/Guest/template_snapshot_deletion.md@@ -121,8 +121,26 @@ still writing about 2 GB while the snapshot went. The day before, the same callfrom a vphoned with only `com.apple.developer.vfs.snapshot` answered`not_permitted`.-## Not yet verified--- The reclaim of a deletion made by vphoned inside a template build has not- been read off the host image; the 1.19 GB above comes from the prototype run- after an offline trim.+## Reclaim in a template build++Measured on 2026-10-08 in a template build (iPhone17,3 iOS 27.0 24A435,+standard trim, then the setup boot with vphoned deleting the snapshot). The+host image cannot isolate it, because the setup boot writes first-boot state+at the same time, so the System volume's Capacity Consumed was read from the+stopped image (`diskutil apfs list` on a read-only attach) at each stage:++| Stage | System volume | Data | User |+| --- | --- | --- | --- |+| After `cfw install` and Launchpad's first boot | 16,209,444,864 B | 1.17 GB | 0.46 GB |+| After `vm template trim --tier standard` (1.166 GB of files) | 16,209,846,272 B | | |+| After the setup boot | 15,022,374,912 B | 1.67 GB | 0.69 GB |++The System volume shrank by 1,187,471,360 B (1.19 GB): the 1.166 GB trimmed+plus about 21.6 MB held only by the snapshot, the same split as the prototype+run. On the host, `Disk.img` (sampled every 2 s) went from 17.948 GB to+16.620 GB within about 10 s of the snapshot step, then grew back with the setup+boot's writes to 17.545 GB at shutdown. The 1.33 GB drop is 0.14 GB more+than the System volume's, probably discards from the other volumes in the+same seconds. The frozen template was 17.58 GB, against 18.92 GB for a+template with neither trim nor setup boot and 19.3 GB for one with a setup+boot and no trim.diff --git a/Research/Guest/virtual_camera_transport.md b/Research/Guest/virtual_camera_transport.mdindex d27c2fdb..327467d7 100644--- a/Research/Guest/virtual_camera_transport.md+++ b/Research/Guest/virtual_camera_transport.md@@ -138,3 +138,8 @@ the life of their process:After both changes `cameracaptured` took about one wakeup a second in the samewindow, and AccessibilityUIServer and InputUI dropped from about 900 each tounder 10. The numbers are in [`service_trimming.md`](service_trimming.md#idle-cost-of-vphones-own-components).+Camera frames were not checked live after the change: an iPhone 27.0 guest+publishes no synthetic camera at all (`libvcamcaptured` logs `_sSourceList not+located` on every boot), so nothing can start the drive there. That is a+separate open item ([iOS 27 capture sources](ios27_capture_microphone_source.md#4-the-virtual-camera-does-not-change-this)).+On 26.6.2 the synthetic source is published and the Camera app starts.diff --git a/Research/Host/machine_identity_and_clone.md b/Research/Host/machine_identity_and_clone.mdindex d30051e3..a38511a8 100644--- a/Research/Host/machine_identity_and_clone.md+++ b/Research/Host/machine_identity_and_clone.md@@ -127,8 +127,10 @@ and a clone's disk image:`nvram.bin` and `SEPStorage` are cloned too and diverge by a few blocks.A clone therefore costs about 0.35 GB after its first boots and grows withuse, where a restore writes about 20 GB plus an 11 GB temporary restore tree.-`du` and Launchpad's size column report the full 20 GB for every clone, and-deleting the source frees no shared blocks while a clone remains.+`du` reports the full 20 GB for every clone (Launchpad's Exclusive column+compares extents instead), and deleting the source frees no shared blocks+while a clone remains. How this compares with the other ways of saving disk+space is in [disk space](disk_space.md).## Shared state and caveats@@ -141,7 +143,12 @@ deleting the source frees no shared blocks while a clone remains.keys, was not tested.- The host trusts each guest by UDID, so lockdown tools need the guest's"Trust This Computer" prompt again after a new identity. Tapping Trust and- then `idevicepair pair` worked.+ then `idevicepair pair` worked. Copying the host's pair record+ (`/var/db/lockdown/<old UDID>.plist`) to the new UDID might skip the+ prompt; it needs root, so a Launchpad helper verb, and was not tried.+- A plain clone keeps the source's ECID and MAC, so it has the same UDID and+ competes for the same DHCP lease if both run: it is a backup, not a second+ machine.- A clone that later runs `restore` is personalized for its new ECID, asusual. `cfw update-kernel` and `--update-environment` write through a hostmount and do not involve the ECID.diff --git a/Research/Host/machine_templates.md b/Research/Host/machine_templates.mdindex c3c0441e..4474cbd4 100644--- a/Research/Host/machine_templates.md+++ b/Research/Host/machine_templates.md@@ -6,7 +6,9 @@ from it with `clonefile(2)` and a new identity (see[machine identity and clone](machine_identity_and_clone.md)), so a secondmachine for the same firmware costs a clone and a few hundred MB of first-bootwrites instead of a 20 GB restore. User-facing behavior is in-[Create and run](../../Documents/Guides/create-and-run.md#templates).+[Create and run](../../Documents/Guides/create-and-run.md#templates). What+templates save against the alternatives that were measured, and the build and+clone timings, are in [disk space](disk_space.md).Code: `VPhoneKit/VPhoneCoreKit/Bundle/VPhoneMachineTemplateKey.swift` (the key,pure), `VPhoneMachineTemplates.swift` (storage, freeze, adopt, clone, boot@@ -496,7 +498,10 @@ conservative trim afterwards and `aggressive` were refused, and so wasbooted through Launchpad to the Setup greeting with vphoned answering and 258apps registered, no panic. With P4's snapshot deletion the 2026-10-07prototype returned 1.19 GB for the same deletions-(`Research/Guest/template_snapshot_deletion.md`).+(`Research/Guest/template_snapshot_deletion.md`), and so did a full build's+setup boot, read off the System volume (that note's "Reclaim in a template+build"). Where these paths sit among the System volume's 16 GB, and why the+other large items are never trimmed, is in [disk space](disk_space.md).`vm delete` of the second of two machines cloned from a template printed`note: template 2246f982776c (~18.92 GB) is no longer used by any machine; …`;@@ -603,6 +608,12 @@ the profile is applied, that nothing fell short of the plan(`VPhoneTemplateSetupOutcome.deviations(from:)`) and fails before the rebootif anything did.+After the reboot the verify step sometimes finds a removed app listed again+for a few seconds (`removed apps are installed again: com.apple.tv` three+times in one 27.0 build; News and TV for about 6 s on 26.6.2), and the next+poll finds it gone. The step's retries absorb it; a reappearance that lasted+past the 120 s deadline would fail the build.+An app left behind was seen once in two setup boots on 27.0 (2026-10-08,Find My): "LaunchServices still lists the app after unregistration". icli's`unregisterApp` looks at the record straight after `icli_unregister_app`, and@@ -665,6 +676,15 @@ cleared: 13 crash report(s): duetexpertd ×11, SiriSearchFeedback ×1,panic-full ×1` (2026-10-09 build). A report it cannot delete is a warning, asthe device name is.+The report could be avoided at the source by stopping the DFU VM when iBoot+prints its banner after the restore, instead of waiting for the panic. That+would remove the panic and its report for every machine, `--no-template`+included, and save a few seconds. It is not done: it changes the stop+condition in both `vm create` and Launchpad (which must keep working with+older bundles of its series), and one full creation has to confirm that+nothing required happens in that boot; the logs show only Preboot mounted+before launchd.+The reboot step's 33 s: `system.reboot` is answered at once, and the first`ping` a moment later can still reach the old vphoned; the `processes.list`sent after it reaches vphoned as launchd stops it and is never answered, so