DEV Community

Cover image for Best Ways to Keep Mac Awake
Bohdan Bilous
Bohdan Bilous

Posted on • Edited on

Best Ways to Keep Mac Awake

Have you ever been in the middle of an important task, only for your Mac to dim the screen or go to sleep at the worst possible moment? Whether you’re giving a presentation, running a long download, monitoring real-time data, or just stepping away briefly, there are plenty of situations where you might need your Mac to stay awake.

Fortunately, there are multiple ways to prevent your Mac from sleeping — some built-in, and others requiring a little extra help. Let’s explore the best options.

1. Adjust Energy Saver Settings

One way to prevent your Mac from sleeping is to modify the system settings:

For macOS Ventura and later:

  1. Open System Settings → Displays → Advanced
  2. Enable Prevent automatic sleeping when the display is off

For macOS Monterey and earlier:

  1. Go to System Preferences → Energy Saver
  2. Adjust the Turn display off after slider to “Never”

This method works well if you only need to keep the system awake while plugged in. However, it doesn’t always prevent applications from detecting inactivity.

2. Use Terminal Command

For those comfortable with the command line, macOS provides a built-in tool called caffeinate that prevents sleep temporarily.

How to use it:

  1. Open Terminal
  2. Type: caffeinate -d

This keeps your Mac awake until you close the Terminal window.

To stop it, press Control + C or close the Terminal window.
You can also use additional options like caffeinate -t 3600 to keep the Mac awake for an hour.

3. External Hardware Solutions

Some users opt for external hardware-based mouse jigglers, which are small USB devices that move the cursor automatically. These are plug-and-play solutions that don’t require software installation. While effective, they’re less flexible compared to software options.

4. Third-Party Apps for Keeping Your Mac Awake

Sometimes, built-in settings aren’t enough, especially if certain applications check for activity beyond system-level sleep prevention. That’s where third-party apps come in.

Mouse Jiggler for Mac

Mouse Jiggler for Mac — For Simulating Activity
Unlike traditional sleep prevention apps, Mouse Jiggler works by simulating actual cursor movement, which some applications and policies require to detect activity.

When this is useful:
• Remote Desktop & Virtual Machines — Apps like Citrix, VMware, and Microsoft RDP may log you out if there’s no mouse or keyboard activity.
• Web Applications & Security Portals — Some platforms enforce automatic logouts unless movement is detected.
• Live Monitoring Dashboards — Stock trading platforms, analytics dashboards, or real-time monitoring tools often pause or time out without user interaction.
• Software Testing & Automation — Developers and IT professionals can use it to simulate user input during testing.

Mouse Jiggler also includes Silent Mode, which moves the cursor invisibly to avoid interfering with workflows, along with customizable deactivation options.

*Download for free from the App Store: *https://apps.apple.com/app/id6740313656

Which Method Is Right for You?

The best way to keep your Mac awake depends on your needs:
✅ For presentations, sleep prevention or preventing logouts in remote sessions → Mouse Jiggler provides actual movement detection.
✅ For command-line users → Terminal’s caffeinate command is a quick and easy option.
✅ For a plug-and-play solution → A hardware jiggler might be a good choice.

Keeping your Mac awake doesn’t have to be complicated. Whether you prefer a built-in option or a third-party tool, there’s a solution that fits your workflow.

What’s your preferred way to keep your Mac awake? Let us know in the comments! 🚀

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

🌶️ Newest Episode of Leet Heat: A Game Show For Developers!

Contestants face rapid-fire full stack web dev questions. Wrong answers? The spice level goes up. Can they keep cool while eating progressively hotter sauces?

View Episode Post

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️