How to change lid behaviour on MacBook Air and Pro
Good news: almost exactly three years after I reported that you couldn’t control what an Apple silicon MacBook Pro or Air does when you open its lid, Apple has addressed this.
Intel models
Since about 2016, Intel MacBook Air and Pro models may have an ‘auto boot’ feature, and either start up or wake from sleep when you open their lid. This behaviour is controlled by the AutoBoot setting in their NVRAM. If you want to disable auto boot startup, then open Terminal, type in the command
sudo nvram AutoBoot=%00
and authenticate with your admin password. When you next open the lid, that Mac won’t start up until you tell it to.
To disable that, and restore auto boot, enter the Terminal command
sudo nvram AutoBoot=%03
and authenticate again. It will also be restored if you reset NVRAM.
Apple silicon models
The procedure for Intel Macs doesn’t work in Apple silicon models, and the NVRAM setting that looked as if it might work, auto-boot, mustn’t be used as it can cause boot problems. Leave it well alone unless you fancy performing a full restore in DFU mode.
According to Apple’s recent support note, it’s now possible to change auto boot behaviour in MacBook Air and Pro models with Apple silicon chips using the BootPreference setting, when they’re running macOS Sequoia.
To disable auto boot when opening the lid or connecting to power, enter the Terminal command
sudo nvram BootPreference=%00
To disable auto boot when opening the lid, but for it still to work when connecting to power, enter the Terminal command
sudo nvram BootPreference=%01
To disable auto boot when connecting to power, but for it still to work when opening the lid, enter the Terminal command
sudo nvram BootPreference=%02
To restore normal auto boot behaviour, enter the Terminal command
sudo nvram -d BootPreference
to delete that setting in the NVRAM.
You can also list the contents of NVRAM with the command
nvram -p
which is helpful when you’re not sure what the setting is, or whether it has been removed from NVRAM altogether to return that Mac to its default behaviour.
Be particularly careful when making any changes to the NVRAM in an Apple silicon Mac: if you make a mistake there’s no easy way to reset the NVRAM, and your Mac could be taking a trip to DFU mode before it will work properly again.
Cleaning keys or trackpad
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. Water damage is included in AppleCare+, but will still cost you $299, and may not be covered by other insurance policies.