1

My old 2012 MacBook air suddenly shut down. I had the battery recently replaced by a non-Apple shop since Apple has already obsoleted this model.

The battery was somewhere between 60% and 80% when this happened. I wasn't doing anything particularly power-consuming, WiFi was on but I was just editing some slides (no active browsing or movie-watching).

I plugged the power in and restarted. The date was reset to something in 2018 and the time was wrong. I connected to the internet and let it auto-reset.

I've had this new battery a month or two and it's worked fine until today; I can work offline for ~5 hours and still have ~30% charge left.

Question: I've never looked closely at the console reports before so I don't know how to search for a sudden shut down, possibly due to loss of power. I do know that I had to reset the clock after starting again. How can I zero in on "something bad happened" reports?


Battery Information:

  Model Information:
  Serial Number:    W0137xxxxxxxx
  Manufacturer: SMP
  Device Name:  BQ20Z451
  Pack Lot Code:    0
  PCB Lot Code: 0
  Firmware Version: 201
  Hardware Revision:    000a
  Cell Revision:    158
  Charge Information:
  Charge Remaining (mAh):   7596
  Fully Charged:    No
  Charging: Yes
  Full Charge Capacity (mAh):   7845
  Health Information:
  Cycle Count:  31
  Condition:    Normal
  Battery Installed:    Yes
  Amperage (mA):    333
  Voltage (mV): 8362
3

1 Answer 1

2

You can get the previous shutdown cause from the log history.

In macOS Sierra and later with unified logging:

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

Earlier than macOS Sierra, filer system.log for some recent results:

grep "Previous shutdown cause" /var/log/system.log

Then look up the code on this table I maintain: Previous Shutdown Causes Explained

6
  • Thanks, I'm having trouble with that line. I've pasted it into Terminal and iTerm2 and both return -bash: log: command not found
    – uhoh
    Dec 12, 2019 at 21:40
  • @uhoh What version of macOS are you using?
    – grg
    Dec 12, 2019 at 21:41
  • 1
    It's embarrassingly old, El Capitan 10.11.6
    – uhoh
    Dec 12, 2019 at 21:44
  • 1
    @uhoh Ah that doesn't have the log command, edited answer with alternative command
    – grg
    Dec 12, 2019 at 21:55
  • 1
    Grg if it searches for exact string match, maybe el cap didn’t use this phrase..
    – anki
    Dec 13, 2019 at 5:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .