Answers:
安排从睡眠中唤醒的另一种方法是使用pmset:
sudo pmset repeat wakeorpoweron MTWRFSU 03:45:00
launchd无法将计算机从睡眠中唤醒,但是它确实会在唤醒后运行在睡眠期间安排的作业。如果其他人搜索该操作方法,则可以将该plist保存为~/Library/LaunchAgents/some.label.plist
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>some.label</string>
<key>ProgramArguments</key>
<array>
<string>say</string>
<string>a</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>23</integer>
<key>Minute</key>
<integer>59</integer>
</dict>
</dict>
</plist>
然后运行launchctl load ~/Library/LaunchAgents/some.label.plist
。