Mac Won’t Sleep? Here’s How to Find Out Why And Fix It
On the rare occasion that you go to put a Mac to sleep and, well, it won’t sleep, there’s an easy to way to find out what the holdup is. Though this is a somewhat technical approach, it should give a good starting point to anyone who’s confused as to why something like automatic sleep isn’t taking effect, and hopefully provide a quick resolution to the problem.
Determining the Cause of Sleep Prevention in Mac OS X with the Command Line
This works to determine both why a Mac won’t sleep and why a Mac display is not sleeping:
- Launch Terminal from /Applications/Utilities/ and type the following command:
- Look through the reported assertion list for items with a “1” next to their name to find what’s keeping the Mac awake
pmset -g assertions
For example, if you see something like the following:
$ pmset -g assertions
7/11/12 10:45:33 PM PDT
Assertion status system-wide:
PreventUserIdleDisplaySleep 0
CPUBoundAssertion 0
DisableInflow 0
ChargeInhibit 0
PreventSystemSleep 0
PreventUserIdleSystemSleep 1
NoIdleSleepAssertion 1
ExternalMedia 0
DisableLowPowerBatteryWarnings 0
EnableIdleSleep 1
NoRealPowerSources_debug 0
UserIsActive 0
ApplePushServiceTask 0
Listed by owning process:
pid 1827: [0x000000bb012c01f1] PreventUserIdleSystemSleep named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,1:0'.noidlesleep"
You’ll notice the “sleep when idle” feature is disabled, but what you really want to pay attention to is the lower portion of the list where the “Listed by owning process” report shows com.apple.audio as the reason that PreventUserIdleSystemSleep is enabled. Why is that? Because iTunes is running and playing music, meaning the computer isn’t idle.
If you’re having persistent problems with sleep and the above tip doesn’t give you any clue as to where to begin, sleep issues relating to hardware and power management quirks can often be fixed with an SMC reset. On the other side of the fence, another command line tip shows us how to find out why a Mac woke up from sleep. Sometimes the same thing preventing a Mac from sleeping is responsible from waking it up too, like Time Machine and schedule backups.
This is a handy tip from Lifehacker who also provides a similar tip for Windows computers. Don’t miss Apple’s article on the topic too for some additional help.
I have the same computer, same problem. When I was running Yosemite I could open terminal and enter the command βsudo killall configdβ which seemed to work, but not on High Sierra
Hopefully someone has an answer to this one… I have 2009 Mac Pro and when I log off, and then click “sleep” the system seems to go to sleep, but despite the screen staying blank, it sounds like someone is constantly waking and then sleeping the system.
Thanks for this useful command, greatly appreciated.
Resolved:
After nearly going completely crazy trying to disable everything, it turned out to be the Common Unix Printing System (thanks to DGKApps.com).
Turn off the CUPS from the command line:
sudo launchctl unload -w /System/Library/LaunchDaemons/org.cups.cupsd.plist
You can re-enable it with the following:
sudo launchctl load -w /System/Library/LaunchDaemons/org.cups.cupsd.plist
You can test to see if itβs running with the following command:
sudo launchctl list | grep cupsd
I even force quit apple music and I put the command in again and it still shows “com.apple.iohideventsystem.queue.tickle.4294967990.3”
OMG I had I pending print job from like 2 years ago from a printer I don’t have anymore. I deleted it and now my mac can sleep again! :D
Thanks Bruno!
Thanks Bruno – after a lot of time spent looking into techie solutions, it turned out that a job hadn’t printed and was just sitting there in my Epson printer utility.
Jan D, you’re a life saver! My problem was also the HP printer queue. Thanks!
After trying everything i could find on the web, i figured out that it was a page in the (HP) printer queue that was keeping my Mac from sleeping for days. Turned on the printer, forced the page to print and my Mac is now FINALLY going back to sleep.
There was no indication of this in the Activity Monitor nor the “pmset -g assertions” command that pointed to anything printer related. Hope this helps someone !
Thanks! You solve my problem.
i discovered it was my internet connection sharing that was preventing sleep mode.
New iMac 2012 would not stay asleep. Found out it was the HP USB keyboard keeping it awake. Switched keyboard and the problem went away. Hope this helps someone.
jfsjfs
Hi!
This one is the hero of the day, thanx a lot!
internet sharing was my problem. Disabled it from preferences and voilΓ‘ no problems to sleep. I think it was related to i share my printer by wifi, but at least now i know what to do.
Happy new year and thanx a lot for this article!
/Max
Ok, now I know that ExternalMedia is preventing sleep but how can I fix it? Shouldn’t it be possible to put a mac to sleep a mac with a HDD connected?
I was having issues with my Macbook Pro not sleeping at all (not with the lid closed nor by selecting “Sleep” in the Apple menu) and resetting the SMC didn’t help. The above tip didn’t show me what was cauing it.
After some internet searching I learned that pending printing jobs are commonly the cause. Especially when you have added online printers (in my case it was a wireless HP printer AND a Xerox network printer). If you go to your printer list you’ll eventually find one that is “in use” even if it was the shared wireless printer in the hotel lobby on your last vacation. Simply delete any pending jobs or erase the printer altogether.
Worked for me!
Thanks Bruno, I was getting the same problem and checked my printer, its low on ink and had some printing pending. Cancelled it now the sleep function works as it should.
Cheers,
John.
Thanks, Bruno.
That’s exactly the info I needed!
It works now.
Thanks Bruno, so simple and finally sorted the problem.
Thanks, this great tip also solved my problem.
I have two printers connected and the oldest one i don’t use anymore. That printer had one job in queue and kept like you said my mac from going into sleep mode.
problem solved.
Thanks
Bruno, you rock my good sir. I simply deleted a pending printing job and my computer went to sleep like a baby.
Thanks a million
Thanks Bruno, this worked for me as well!
Not going to sleep neither automatically nor the forced sleep made me crazy – I even updated to Sierra ;-)
Kept me busy way too long to find the reason!
Checked all printers and there it was: an old printing job for a switched off printer (waiting to replace one ink tank -therefore not in use). Deleted that job and used the forced sleep and the Mac mini actually went to sleep right away.
I had this problem so many times on different Macs in the past and never found out what actually resolved the problem.
I hope I do remember it for the next time!
Cheers from Germany,
Mat
Just another thank-you to Bruno Pascoal. After much searching, thanks!
OMG I had I pending print job from like 2 years ago from a printer I don’t have anymore. I deleted it and now my mac can sleep again! :D
Thanks Bruno!
Iβve found a little over a year ago that the voice commands / speech recognition prevents my iMac and macbook from going to sleep if itβs used even once. I opened a ticket with Mac who acknowledged the problem but wouldnβt commit to a fix. I have to recycle speakable items.
Plus speech recognition has a huge memory leak, about 750m / day.
This is a pretty interesting find.