Skip to content

feat: slim a shutdown simulator by writing its launchd overrides offline - #49

Merged
Interlap01 merged 1 commit into
MobAI-App:mainfrom
plu:feat/offline-disable-store
Sep 19, 2026
Merged

Interlap01 merged 1 commit into
MobAI-App:mainfrom
plu:feat/offline-disable-store

Conversation

@plu

@plu plu commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@Interlap01
Interlap01 merged commit 4ae1659 into MobAI-App:main Sep 19, 2026
1 check passed
@Interlap01

Copy link
Copy Markdown
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants