Whenever I leave my MacBook Pro (Retina, 13-inch, Early 2015) unattended (plugged in, or not) overnight (or for long periods of time) it shuts down by itself. When I open the lid it boots up to the FileVault password screen. It seems that if the lid is up, the laptop does not shut down.
It is running the latest and greatest macOS Sierra build (10.12.3 (16D32)).
There is no kernel panic, and I cannot find anything in the logs or settings that would cause this behavior. I tried searching and did a SMC reset.
EDIT
log show --style syslog --predicate 'eventMessage contains "shutdown cause"'
Skipping info and debug messages, pass --info and/or --debug to include.
Filtering the log data using "eventMessage CONTAINS "shutdown cause""
Timestamp (process)[PID]
2017-02-08 09:54:22.064782-0800 localhost kernel[0]: (AppleSMC) Previous shutdown cause: 3
2017-02-08 20:07:46.801647-0800 localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2017-02-10 07:52:07.041401-0800 localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0
2017-02-10 19:10:11.005920-0800 localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0
2017-02-11 10:17:08.462940-0800 localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2017-02-12 10:22:55.834601-0800 localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0
EDIT 2 It turned out that the batteries on the laptop were failing. We sent the laptop to Apple for fixing under Apple Care.
log show --style syslog --contains "shutdown cause"
It will give you and error code. Post that to your original question. – Allan Feb 13 '17 at 18:33sierra
as well it's mentioned in the OP and thelog
command in macOS Sierra does not contain an option named--contains
, although there is a--predicate
option which filters messages based on the provided predicate. – user3439894 Feb 13 '17 at 18:44syslog
I found myself having to memorize a whole new set of commands.... – Allan Feb 14 '17 at 21:48-the same model as yours but running high Siera 10.13.1-
restarted on its own. When I log in itDoes Not
prompt me to report a problem or anything like that to Apple meaning its like it was restarted cleanly and am so sure it wasn't because I just select the sleep button. For me, the command you used showsshutdown cause: 5
for all of them. Any other commands I can use to investigate the problem? – lukik Dec 20 '17 at 5:17