Repository navigation
feat: slim a shutdown simulator by writing its launchd overrides offline - #49
Merged
Merged
Conversation
Slimming a simulator cost a boot, one `launchctl` spawn per label, and a reboot to apply them — 2m14s for the default 170-label profile. A device that is already shut down does not need any of that: launchd_sim is a host process, and it reads its disable overrides at startup from a per-device host directory keyed only by UDID, next to the device's launchd.log. Writing them there before the boot makes the simulator come up slim the first time. Measured on an iPhone 17 Pro / iOS 26.5: a first slim goes from 2m14s to 33s, nearly all of it the boot itself, and `on --preserve-boot-state` from a cold device takes 15s. `verify` reports 170/170 and 78 daemons remain, matching a simulator slimmed the old way. The path is an undocumented CoreSimulator detail, so it is best-effort rather than trusted. Writes merge, leaving both the runtime's own explicit-enable entries and any unmanaged label untouched. The booted device is always read back with `print-disabled`, and an unwritable store or a runtime that ignores it falls back to the `launchctl` path instead of failing or reporting a slim simulator that isn't one.
Contributor
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slimming a simulator cost a boot, one
launchctlspawn per label, and a reboot to apply them — 2m14s for the default 170-label profile. A device that is already shut down does not need any of that: launchd_sim is a host process, and it reads its disable overrides at startup from a per-device host directory keyed only by UDID, next to the device's launchd.log. Writing them there before the boot makes the simulator come up slim the first time.Measured on an iPhone 17 Pro / iOS 26.5: a first slim goes from 2m14s to 33s, nearly all of it the boot itself, and
on --preserve-boot-statefrom a cold device takes 15s.verifyreports 170/170 and 78 daemons remain, matching a simulator slimmed the old way.The path is an undocumented CoreSimulator detail, so it is best-effort rather than trusted. Writes merge, leaving both the runtime's own explicit-enable entries and any unmanaged label untouched. The booted device is always read back with
print-disabled, and an unwritable store or a runtime that ignores it falls back to thelaunchctlpath instead of failing or reporting a slim simulator that isn't one.