Friday, January 31, 2025

Preventing a Mac Laptop From Turning on When Opening Its Lid

Apple (via MacRumors):

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.

[…]

  • 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

This makes it possible to clean the keyboard with the Mac off and to prevent battery drain due to Power Nap by keeping it off instead of asleep. You can still power on the Mac by pressing the power/Touch ID key.

Dave Mark:

Interesting that this requires the Terminal, no setting to change this behavior. Plenty of other examples of this, but not used to seeing an official support document that sends you to Terminal as only path.

Previously:

Update (2025-01-31): Zsolt Benke notes that this doesn’t allow cleaning the keyboard because pressing a key will still start up the Mac. However, you can temporarily disable this:

  • Press and hold the left Control and Command buttons with right Shift button for a total of 7 seconds.
  • Without releasing them, press the Power button and hold together for an additional 7 seconds until your laptop shuts down. The login screen may flash for a second so don’t prematurely release the keys until the machine is off.
  • For your next startup, your Mac can only be powered on by using the Power button or closing and opening the lid.

This worked for me, but only if I didn’t close the lid before pressing a key.

Update (2025-02-07): Jeff Nouwen:

In my case I wanted to stop the constant waking from spinning my DAS up and down all the time, but this worked for me both with a 2020 Intel iMac and now with my M2 Studio: disable CoreSmartPowerNap.

Oh, and the other piece of the puzzle is to clear and then block the OS from scheduling anything ELSE from waking the machine (calendar time-to-leave reminders, etc.).

Howard Oakley:

Auto boot only determines start up behaviour on opening the lid or connecting power. When the lid is open, pressing any key or using the touchpad will still cause the Mac to start up, so limiting use for cleaning its keys or touchpad. Apple recommends using compressed air, which shouldn’t start the Mac up, but if you prefer to use a dry cloth or isopropyl alcohol on a cloth (but never a water-based cleaner), then you may find it helpful to use KeyboardCleanTool to block key entry during cleaning.

Whatever you do, don’t let any water=based liquid near your Mac’s keyboard or other areas that could allow its ingress. Even small amounts of water can cause serious damage that can require expensive repairs. Like all laptops, MacBook Air and Pro models contain multiple water sensors, making that damage easy to detect.

4 Comments RSS · Twitter · Mastodon



If this is all so that you can clean the keyboard, then https://folivora.ai/keyboardcleantool is a free app for temporarily disabling keyboard input, from the dev of the awesome Better Touch Tool.


Zsolt's instructions are the same as resetting the SMC for a T2 Mac: https://support.apple.com/en-us/102605

Not sure why that would do anything on an M-series Mac, except that it is close to the process for entering DFU mode: https://support.apple.com/en-us/108900


@Alexander: There were probably changes between the different M-series silicons, since I could activate this on my M1 MacBook Pro, but not on a M3 Air.

Leave a Comment