跳转到主内容

简介

This guide will show you how to determine why exactly your Mac shut down or restarted using macOS's built-in logging.

  1. Open Terminal.app
    • Open Terminal.app

  2. Copy and paste the following command in your Terminal window:
    • Copy and paste the following command in your Terminal window:

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

    • The "24h" portion of the command can be changed to any number of hours, depending on how far back you need to see.

  3. The previous shutdown causes in the timeframe you selected will appear as a list.
    • The previous shutdown causes in the timeframe you selected will appear as a list.

    • Common shutdown causes include 5 which indicates a normal shutdown, 3 which indicates a hard shutdown (i.e. holding the power button), and 0 which indicates the power was disconnected.

    • A full list of shutdown causes can be found here: Shutdown Causes.

结论

Done! You should be able to use these codes to further troubleshoot random shutdowns or other strange events.

Hit the button below if this guide helped solve your issue :)

4等其他人完成本指南。

附加文件

Jonah Aragon

于2018年08月05日注册

2,925 信誉积分

创作了4篇指南

团队

Experimax Coon Rapids Experimax Coon Rapids 的会员

Business

2 名成员

创作了4篇指南

添加评论

浏览统计数据:

过去的24小时: 12

过去的7天: 142

过去的30天: 593

总计 2,774