修复mac mojave不能休眠问题


自从买了mbp第一个月尝试了一下osx一个月感觉不适应,然后就换了win10,一用就是5年。最近想再尝试用一下macos,然后就升级到了mojave。我发现合上盖子后,机器似乎一直在工作。连接的外设也都还通电状态。很无语。跟windows下的休眠状态完全不同。我又打起了退堂鼓。但是想起一位仁兄说的,macOS中总能找到解决办法,于是硬着头皮继续干,最后发现可以通过命令行修改mac的电源设置。有个命令叫pmset一个电源管理的程序。可以在终端中输入:man pmset

其中有个睡眠模式的参数hibernatemode可以用来调整睡眠状态。有0,3,25三个参数

hibernatemode = 0 by default on desktops. The system will not back memory up to persistent storage. The system must wake
from the contents of memory; the system will lose context on power loss. This is, historically, plain old sleep.

hibernatemode = 3 by default on portables. The system will store a copy of memory to persistent storage (the disk), and
will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from hiber-
nate image.

hibernatemode = 25 is only settable via pmset. The system will store a copy of memory to persistent storage (the disk),
and will remove power to memory. The system will restore from disk image. If you want “hibernation” – slower sleeps,
slower wakes, and better battery life, you should use this setting.

使用25就可以了

在终端中输入:

sudo pmset -a hibernatemode 25

其中参数-a(全部)可以替换为-b(电池)或 -c(电源)

普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress