Why does my computer keep turning on when I close my computer lid?

My Macbook pro with a M2 chip will not stay shut down. I have shut it down various ways and every-time I close the lid it will always restart automatically. It has been doing this for a few months but never as frequently as it has been since yesterday and today. I don't know if their is a batter issue or a sensory issue but if I do need to get something repaired how much would it cost? I do not want to leave it on sleep mode all night or for longer than I have too

MacBook Pro 14″, macOS 15.3

Posted on Feb 3, 2025 10:19 PM

Reply
10 replies

Feb 4, 2025 4:40 AM in response to holly_matc

Prevent a Mac laptop from turning on when opening its lid or connecting to power


A Mac laptop with Apple silicon automatically turns on and starts up when you open its lid or connect it to power. With macOS Sequoia 15 or later, you can change this behavior without affecting your ability to use your keyboard or trackpad to turn on your Mac.

  1. Make sure that your Mac laptop with Apple silicon is using macOS Sequoia or later.
  2. Open the Terminal app, which is in the Utilities folder of your Applications folder.
  3. Type one of these commands in Terminal, then press Return:
    • To prevent startup when opening the lid or connecting to power: sudo nvram BootPreference=%00
    • To prevent startup only when opening the lid: sudo nvram BootPreference=%01
    • To prevent startup only when connecting to power: sudo nvram BootPreference=%02
  1. Type your administrator password when prompted (Terminal doesn’t show the password as it's typed), then press Return.

To undo any of the previous commands and reenable automatic startup when opening the lid or connecting to power, enter  sudo nvram -d BootPreference in Terminal.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Why does my computer keep turning on when I close my computer lid?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.