macOS High Sierra restarting by itself during sleep I have a 2017 MacBook Pro 15″ with High Sierra. I never turn off my laptop, instead I simply put it to sleep, so next day it's easier and faster to turn it on.

But often when I wake it up the next day, it has rebooted by itself. How can I see the shutdown/reboot cause, to try to fix it?

Here is the result of command "pmset -g"

System-wide power settings:
Currently in use:
 standbydelay         10800
 standby              1
 womp                 0
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 powernap             0
 gpuswitch            2
 networkoversleep     0
 disksleep            0
 sleep                15 (sleep prevented by nsurlsessiond, nsurlsessiond, sharingd, coreaudiod)
 autopoweroffdelay    28800
 hibernatemode        3
 autopoweroff         0
 ttyskeepawake        1
 displaysleep         15
 tcpkeepalive         1
 acwake               0
 lidwake              1
You can find the last shutdown cause by examining the logs. Run this command to filter the logs for shutdown causes:

log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h


You can then lookup the shutdown cause code in this table: macOS Shutdown Causes.