SCDynamicStore and IOKit power callbacks delivered in the sandbox to end the wake settle window
Parent: Apple Platform Publishing (Mac App Store) · Published reference · snapshot 2026-10-29
↓ Facts as markdownall context files
Source-anchored research for SCDynamicStore and IOKit power callbacks delivered in the sandbox to end the wake settle window. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Structure and components
- SCDynamicStore contains current system-configuration values, including network state, and lets clients register selected keys or key patterns for change notifications delivered through a dispatch queue or run-loop source. This is a configuration-change signal; it does not by itself mark I/O Kit wake processing as complete. (high confidence) [source]
How it works
- Implementation inference: use a fully-wake IOKit message to re-read current network configuration, and use targeted SCDynamicStore network-key changes to trigger another re-evaluation. The documented callbacks report wake state or changed configuration keys; neither alone reports that a particular remote service is reachable. (medium confidence) [source]
Problems, failure modes and limitations
- Sandbox scope matters. Apple says Mac App Store apps must enable App Sandbox. Separate reports from Nono's custom process sandbox and Claude Code's sandbox settings show IORegisterForSystemPower failure and SCDynamicStore access denial, respectively; those reports do not establish either outcome for a Store-signed App Sandbox build. (medium confidence) (verified as of 2026-10-22) [source]
Comparisons and alternatives
- The IOPMLib.h API contract says IORegisterForSystemPower returns MACH_PORT_NULL if registration fails, and Apple’s sleep/wake sample checks the returned connection before attaching the notification source. Implementation inference: handle a failed registration explicitly rather than assuming a notification source and future callback exist. (medium confidence) [source]
- Apple’s I/O Kit sleep/wake sample identifies kIOMessageSystemHasPoweredOn as the event where the system has finished waking. The xAI macOS listener maps that message to DidWake, so it is a suitable event for ending a wake-settle window instead of relying only on a fixed timer. (high confidence) [source]
- Separate macOS tool-sandbox reports describe SCDynamicStore access failing at the configd Mach-service boundary and IORegisterForSystemPower failing in a constrained run. These reports show that sandbox profiles can affect the callback setup, but they do not prove that the standard Mac App Store App Sandbox blocks either API. Test both registrations in the signed store build and handle failure instead of assuming a callback will arrive. (medium confidence) [source]
Facts and statements
- Apple's IOKit sample uses IORegisterForSystemPower to receive sleep and wake notifications and attaches the returned IONotificationPort run-loop source. kIOMessageSystemHasPoweredOn marks completion of wake, while kIOMessageSystemWillPowerOn marks the start. (high confidence) [source]
- SCDynamicStoreSetNotificationKeys subscribes to selected keys or patterns. The callback reports changed keys, and SCDynamicStoreSetDispatchQueue can deliver the callback on a dispatch queue. This is a dynamic-store change feed, separate from IOKit sleep and wake messages. (high confidence) [source]
- IORegisterForSystemPower returns an IONotificationPort for power notifications. The pinned IOPMLib.h contract lists three activation paths: IONotificationPortGetRunLoopSource, IONotificationPortGetMachPort, or IONotificationPortSetDispatchQueue, corresponding to run-loop-source, Mach-port, or dispatch-queue handling. Apple’s sample attaches the run-loop source, and the xAI listener checks the returned connection and port before starting its run loop. (high confidence) [source]
- Apple requires Mac App Store apps to enable App Sandbox and describes sandbox constraints that can stop system libraries from completing otherwise valid operations. The current App Store requirement was verified on 2026-10-29. (high confidence) (verified as of 2026-10-29) [source]
Children
- App Sandbox access to SystemConfiguration and IOKit power notifications (frontier)
- Network readiness checks after macOS wake (frontier)
Frontier under this node: App Sandbox access to SystemConfiguration and IOKit power notifications, Network readiness checks after macOS wake