macOS Clock alarms via Shortcuts | Generated by AI
Here’s the full investigation summary:
What’s happening
macOS 26 Clock.app does NOT read alarms from the plist or SQLite database. The mobiletimerd daemon manages all alarms in-memory and exposes them via XPC at com.apple.MobileTimer.alarmserver. Clock.app only talks to this daemon — never touches the files directly.
What doesn’t work (all tested)
-
Plist write (
~/Library/Preferences/com.apple.mobiletimerd.plist) — daemon ignores it. Clock.app shows “No Alarms”. -
SQLite write (
group.com.apple.mobiletimerd/local.sqlite) — daemon ignores it. Same result. -
pyobjc MTAlarmManager.addAlarm_() — XPC connection rejected:
"not entitled". Only Apple-signed apps with thecom.apple.private.mobiletimerd.alarmserverentitlement can talk to the daemon. -
Compiled Swift binary — same
"not entitled"error. Code signing doesn’t help without Apple’s private entitlement.
What DOES work
Shortcuts.app has the correct entitlements. The user already has a 中国法定节假日闹钟 shortcut that creates alarms. shortcuts run works.
The fix
The _set_alarm function needs to use Shortcuts.app as the bridge. The approach:
-
Create a reusable shortcut (e.g. “ww-create-alarm”) in Shortcuts.app that takes
hour,minute, andlabelas input and creates a Clock.app alarm using theMTCreateAlarmintent action. -
In
_set_alarm, callshortcuts run "ww-create-alarm" --input-path <args>.
The shortcut needs to be created once via the Shortcuts.app GUI (we can guide the user), or we can create a .shortcut file programmatically and import it. The shortcuts CLI supports sign but not import, so the first shortcut creation is a one-time manual step.
Want me to proceed with creating the shortcut and updating alarm.py?