Schedule the machine to wake from sleep, power on, go to sleep, or shutdown.
- macOS 10.3+
- Mac Catalyst 13.0+
Date and time that the system will power on/off.
A CFStringRef identifying the calling app by CFBundleIdentifier. May be NULL.
The type of power on you desire, either wake from sleep or power on. Choose from: CFSTR(kIOPMAutoWake) == wake machine, CFSTR(kIOPMAutoPowerOn) == power on machine, CFSTR(kIOPMAutoWakeOrPowerOn) == wake or power on, CFSTR(kIOPMAutoSleep) == sleep machine, CFSTR(kIOPMAutoShutdown) == power off machine, CFSTR(kIOPMAutoRestart) == restart the machine.
kIOReturnSuccess on success, otherwise on failure
This event will be added to the system's queue of power events and stored persistently on disk. The sleep and shutdown events present a graphical warning and allow a console user to cancel the event. Must be called as root.