How to Prevent Your Mac or MacBook from Sleeping

To prevent your Mac from sleeping, open System Settings > Lock Screen and lengthen the display-off timers, then turn on "Prevent automatic sleeping" in Battery > Options (MacBook) or Energy (desktop). That stays on until you change it back. To keep the Mac awake only when it matters, Shake It On ($9.99 once) moves the cursor slightly under rules you set.

How to stop your Mac from sleeping in System Settings

On current macOS (Sonoma, Sequoia, Tahoe and later) the sleep controls are split across two places:

  1. Open System Settings and click Lock Screen.
  2. Set "Turn display off on battery when inactive" and "Turn display off on power adapter when inactive" to a longer time. A desktop Mac has one display timer.
  3. On a MacBook, click Battery, then Options, and turn on "Prevent automatic sleeping on power adapter when the display is off."
  4. On an iMac, Mac mini or Mac Studio, click Energy and turn on "Prevent automatic sleeping when the display is off."

Still sleeping after that? Something else is in charge, like a schedule, a management profile or a low battery. The guide to why your Mac keeps going to sleep covers each one. Why your Mac keeps going to sleep

The problem

macOS wants your Mac to sleep. It's aggressive about it. Whether you're on a MacBook or a desktop Mac, after a few minutes of no mouse or keyboard activity, the display dims. A few minutes after that, the whole system sleeps. Downloads pause. Remote sessions disconnect. Renders halt mid-frame.

Apple designed it this way on purpose. Sleep saves battery and reduces component wear. But when you're in the middle of something that takes time, sleep isn't helpful. It's destructive.

Why changing your settings doesn't really work

The first thing most people try is the built-in timer: System Settings โ†’ Lock Screen, set the display-off timers to their longest value, then turn on "Prevent automatic sleeping" (Battery โ†’ Options on a MacBook, Energy on a desktop). That stops sleep entirely.

The problem is it stops sleep entirely. Your Mac won't sleep when you walk away for the night. It won't sleep when you close the lid and toss it in your bag. You have to remember to change it back, and you won't.

Note
Energy Saver is a global on/off switch. It doesn't know anything about what you're doing or when you need your Mac awake.

Shake It On: conditional sleep prevention

Shake It On takes a different approach. Instead of telling macOS not to sleep, it moves your mouse slightly at regular intervals. macOS sees genuine user activity and resets the idle timer. Your Mac stays awake because, as far as it can tell, you're still using it.

The key part is the conditions. You don't just turn it on and leave it. You tell Shake It On when to run:

  • Only when plugged into power
  • Only when a specific app is running
  • Only during work hours on weekdays
  • Only when connected to Wi-Fi
  • Pause when the camera is on or Focus mode is active

Your Mac stays awake when you need it to and sleeps normally the rest of the time. You set the conditions once and forget about it.

Shake It On lives in your menu bar and uses organic mouse movement to prevent sleep. Set it once and forget it.

How it works

Shake It On lives in your menu bar. When your conditions are met, it moves the cursor with smooth sine-wave motion every few seconds (you pick the interval and distance). The movement is subtle enough that it won't disrupt what you're doing but enough for macOS to register it as real activity.

This approach has a few advantages over system-level sleep prevention:

  • Corporate environments: Shake It On doesn't change any settings your IT department manages. It moves the mouse, and macOS sees real input. Check your company's rules first.
  • Remote desktop: VNC, Screen Sharing, and TeamViewer use their own idle timers. System sleep prevention doesn't affect those. Mouse movement does.
  • Messaging apps: Slack and Teams set your status based on mouse and keyboard activity. System-level sleep prevention won't keep you "active." Mouse movement will.

It requires macOS 14 or later, works on both Intel and Apple Silicon, and costs $9.99 one-time. No subscription.

Tip
Grant Accessibility permission when prompted during setup. Shake It On needs it to generate mouse movement events. After that, it runs quietly in the background with no dock icon.

Frequently Asked Questions

Can I prevent sleep only during certain hours?
Yes. Shake It On has a schedule feature that lets you set specific hours and days of the week. Outside those times, your Mac sleeps normally.
Will this work if my IT department locked the settings?
Shake It On doesn't change those settings. It moves the mouse, and macOS sees real input. If your company manages your Mac, check its rules first.
How do I prevent my Mac from sleeping on macOS Sonoma or later?
The display-off timers are in System Settings > Lock Screen. The switch that keeps the Mac running with the screen off is "Prevent automatic sleeping" in Battery > Options on a MacBook, or in Energy on a desktop Mac.
How do I stop my MacBook from sleeping when I close the lid?
A MacBook only stays awake with the lid closed when it's plugged in and connected to an external display, plus a keyboard or mouse to use it. Without an external display, closing the lid always sleeps it.
What does "sleep prevented by powerd" mean?
It's pmset's note that a process is holding the Mac awake. powerd holds one while the display is on, which is normal. Run pmset -g assertions in Terminal to see every process and why.
Keep your Mac awake the easy way.
Shake It On lives in your menu bar and uses organic mouse movement to prevent sleep. Set it once and forget it.
One-time purchase. No subscription. Free updates forever.
Lifetime license ยท macOS 14+
Apple Pay, Google Pay or card. Your download starts right after payment, and you can re-download anytime with your purchase email.