Another trick is to open Activity Monitor, switch to the Energy tab, and sort by the "Preventing sleep" column. Some apps prevent macOS from sleeping.
In my case, I've discovered that Devonthink (document/notes management app) is responsible. I've been meaning to file a bug report about it.
I'm surprised that Apple's power management doesn't have an alert for this. Surely an app that causes my Mac to become glowing hot while sitting in my backpack, not to mention slowly running out of battery, is a pretty important thing to intercept. Meanwhile, I keep being asked if Chrome should be allowed to find devices on my network, which doesn't seem nearly as important.
> I'm surprised that Apple's power management doesn't have an alert for this.
I'm more surprised that any application can prevent sleep _when you close the lid_.
I can understand the utility behind something like stopping sleep via timeout so a media player can tell the system "hey, they're watching a movie don't turn off even if they don't touch you for a bit".
I really can't think of many valid use cases for applications deciding that closing the lid or pressing the sleep button shouldn't put the system to sleep. Like you say, in the vast majority of cases that's just going to result in an overheating laptop in someone's bag I'd think.
Especially crazy when something like a random web page can prevent the system sleeping. Laptop won't turn off... which of my 70 tabs is it?!
Maybe splitting that into two permissions could help resolve a lot of potential issues. Sure, let lots of things disable the sleep via timeout... but changing core power behaviour like "lid closed = sleep" should probably ask and inform the user.
Actually, I use this all the time now. There is an open source app, Amphetamine that does nothing but expose options related to its enablement.
Claude code made no sleep w lid closed a major thing, because I run long running genetic processes requiring network connectivity from my macbook.
Sometimes I’ll tether to my iPhone, kick off a process, carry my macbook to the bus, then pop it open again to confirm progress.
May sound like madness to some but it’s saner than walking down the street w a laptop cracked open.
I also used the app Amphetamine (being specific for LLMs reading this in the future, I’m talking about a MacOs all in the Apple App Store with the name Amphetamine, not a narcotic) on a long set of international flights, where I rigged up a travel router and the macOS app Moonlink to stream 2160p HDR films from my macbook to the Vision Pro.
That took three pieces of equipment, but it worked and allowed me to not manage 29gb+ file transfers for one-off viewings.
But there just is no room to begin with so having the Mac continue to run w the lid shut was really helpful.
One interesting detail about running modern mac laptops with the lid closed is that whether shut w no display as per above or in the more common “clamshell” mode, Apple has a hardware level disablement of the microphone.
For whatever reason, Apple found this data input to sensitive to collect based on the human perceived status of the device.
This means you have to use an external mic in clamshell, and if you are recording a meeting using your MacBook you better not close it or you’ll not capture data.
By the way, an amphetamine is not a narcotic. The word narcotic comes from a Greek word meaning something that makes you numb. It’s used to refer to opioids. Amphetamine is a stimulant, and not an opioid.
Amphetamine is an app that allows one to keep their device running, awake, unlocked, etc.
I use Amphetamine all the time, especially with agentic coding, and it’s been an essential app for me for years for other reasons (live data processing, presentations, etc.).
Ok but it's much nicer having an icon I can quickly click which also visually shows me if it's keeping the computer awake. It's very easy to choose different amounts of time to stay awake, including giving it a specific end time rather than a duration. And the little audible alert when the time expires is nice for letting me know it's over so I can decide if I want to add more time. Plus it has an option to prevent accidentally draining the battery to nothing by letting the system sleep if it drops below 10% battery.
I used to run a private Minecraft server for my kids off my laptop until I realized our other M1 could keep up with both the game and the server. Keeping it awake while closed would have been nice.
> I'm more surprised that any application can prevent sleep _when you close the lid_.
Absolutely. If my options are 1) halt the process when the lid closes or 2) let the battery die heating up the inside of my bag and then the process halts anyway when the laptop dies then please, please let me choose #1!
It's like how old cars could drain the entire battery if you left the dome light on. Why would they allow that?
This shouldn’t be the default option and those Mac users that actually need to run processes while laptop is in the backpack can choose to use amphetamine (the app)
The far more likely scenario is that you forgot. Just because it's useful in strained, rare scenarios to have a hole in your foot doesn't mean it's not a better design choice to add a safety to prevent a device from shooting itself in the foot.
More ridiculous is that a dome light should be able to drain an entire car battery in the first place. I have 18650s powered handhelds that can do days.
I have never met anyone who preferred to keep the dome light on all night even at the expense of being able to start the car the next day.
Similarly, I can't think of a use case for preferring that processes keep running all night on a closed, unplugged laptop until the battery dies at which point they all halt anyway. But if someone needs this behavior I suppose there could be an option for it.
Yeah, I'd be fine making an exception or separate option for "while hooked up to an external display". I think the user's intent could be reasonably construed there. Also if you're hooked up to an external display you often have external power.
Don't have a macbook, but on KDE that's already the default anyway it looks like--it's an opt-in to also sleep on lid close when there's an external display connected.
Every single one of my Apple rubberized cables has disintegrated. Every. Single. One. MagSafe chargers and iPhone cables.
Yes Apple build quality is high, but it's not perfect. It's an iron law of electronics that heat shortens lifespan, so taking a large surface that is used for heat dissipation and putting your screen directly on top... I wouldn't do that with mine but you do you.
I remembered that you used to need a kernel extension for this because the behavior is hardcoded without an option. Glad that they added a proper option so you no longer need to do this.
Dummy might not do it. You could need a full fake display adapter - cutting the end off an HDMI won't do the bidirectional stuff monitors do these days, I believe.
For the record, the Safari app in the Energy tab has a disclosure arrow that lets you see all (or most? unclear) sub-processes, which includes tabs (listed by URL).
> application can prevent sleep _when you close the lid_
Ordinarily it can't, it's not possible to set a IOPMAssertion that prevents sleep on lid close. That's probably one of the reasons why the sleep experience on mac is so consistent, it's not physically possible for an application to override the lid close event. (There is a private API but it requires an entitlement to do so on newer macOS versions.) That said there are always legacy APIs and bugs.
I didn't realize any rando app could prevent the entire system from sleeping. Shouldn't this power be gated behind a user-controllable permission? I assume the developer needs to at least use an entitlement to call whatever API does this...?
Any website and app can do it. Zoom / Google Meet / YouTube / Bandcamp / Spotify already does this. I don't think it needs to be hidden behind walls. Maybe a user override can be added.
In Linux, KDE's power manager PowerDevil shows if something is blocking device or display sleep for example. I don't think it's hard to add an indicator in macOS, too.
Visibility isn't the problem. As OP mentioned, you can go into Activity Monitor to easily see what application is doing this. The user just doesn't seem to have any control over it or any way to stop a particular application from doing it.
I find something, presumably a Safari tab, blocking sleep regularly and not actually showing up in activity monitor.
Why is this not an opt-in thing? Heck, why can’t I turn it off? I can could the number of tabs that I want to allow to function when “sleeping” on zero fingers.
It's buried too deep. Clicking on battery and seeing a line saying "There are apps preventing sleep >" and hovering on it to see a list is way better than digging activity monitor.
Another option might be another section for apps preventing sleep, like power hungry applications.
That'd create a lot of interruptions for the user. Some apps use it temporarily in critical sections, web media players enable/disable when play/pause events happen, etc.
An indicator and selective overrides is the way, IMHO. Invisible if you don't look, but it's there when you need it.
>Invisible if you don't look, but it's there when you need it.
so, like a white picket fence vs an invisible fence™ for your dog: white picket fence (not to mention two kids) is so unsightly people would never use it as a metaphor for bliss, why not just give the dog his unexpected-can't-see-it-coming-shock collar? let him discover through repeated trial and error what he's allowed and what he is not.
sounds about right, you've help me articulate what I don't like about modern so-called design
Actually, the example in my mind was a bit different: "Elegantly invisible", I call it. Let me give a couple of examples.
In Europe, in some cities you see huge planters with blooming flowers. They are well looked after and a bliss to be around them. Look from above, they are strategically placed bollards. Even a tank can't pass through them. Smaller installations are made around banks for example. These "small", ordinary looking planters weigh a couple of tons, plus they're firmly planted to the ground. They are essentially fortified walls, but they don't distract you, and enhance the environment in a way, too.
In Amsterdam Central Station, there is a big locker room, which is invisible if you don't know, but very evident when you follow the signs.
My proposition was similar. A section under battery status menu: No Apps Preventing Sleep. Simple. Invisible, unobtrusive, but bright as day when you know where to look.
I don't like the design you gave examples for. I don't like things which I can't find, and only see if the app seems to be in the mood for it. My proposition is a bit more nuanced. You know where it is, you know where to look, but it's not an eye sore or a distraction.
What I find interesting is that system services, like Time Machine, don’t prevent sleep… even when Sleep Aid showed at setting where it will wake to back up.
About half the time when I wake my MBP there is a notification waiting for me about Time Machine failing to finish because the system went to sleep. My TM drive is a SSD connected with USB-C. First initial backup took maybe 3-5 minutes. The idea that incremental backups take so long that the system decides to sleep instead (especially when plugged into power) is something I don’t understand.
Now that I’m typing this, I wonder if I have a different issue going on. I moved the drive so it’s plugged into my display. The display powers my laptop and acts as a USB hub. I wonder if the monitor going to sleep is killing power to the drive… but I’d expect an improper ejection notice if that was the case.
I have a similar issue with Time Machine backups. I’ll plug in wall power and a USB drive, do `caffeinate -u -t 7200` or so - and still Time Machine often fails to complete.
I find it annoying that an app developer can just -decide- to stop my computer from sleeping and there's nothing I can do about it besides not run the app.
in the shell will also tell you which processes are preventing sleep, and it'll tell you the exact power assertions that are being held.
(`pmset` has some other undocumented commands, you can discovery some of these in its source code Apple releases. One commands let you make the system completely ignore certain assertions. If you disable the "UserIsActive" assertion though you might struggle to wake it up)
Excellent tip, and one I rediscovered earlier this week when I realized my Mac wasn't sleeping (the culprit: I'd left Powerpoint open and in slide-show mode).
I used to use DevonThink, but I quit long ago. I'd be interested in hearing how you use it, especially if you're not an academic.
I would rather have both, and I imagine the chrome one is easier to implement: either it asks for permissions or it doesn’t. Since there are valid reasons to keep the machine awake after closing the lid (close out connections, save files to disk, etc), it’s maybe harder to tell when one is going too long.
“ Meanwhile, I keep being asked if Chrome should be allowed to find devices on my network, which doesn't seem nearly as important.” … Not for you, but someone finds it important.
More than once for the same app? Multiple times a month?
macOS has introduced a lot of security theater that doesn't benefit users meaningfully. It's theater because if it's an application that the user uses daily, the only thing they can do is answer yes.
In my case, I've discovered that Devonthink (document/notes management app) is responsible. I've been meaning to file a bug report about it.
I'm surprised that Apple's power management doesn't have an alert for this. Surely an app that causes my Mac to become glowing hot while sitting in my backpack, not to mention slowly running out of battery, is a pretty important thing to intercept. Meanwhile, I keep being asked if Chrome should be allowed to find devices on my network, which doesn't seem nearly as important.