sleep-prevention
Purpose
This guide covers methods to prevent Mac Studio from sleeping, including both permanent system settings and temporary command-line solutions for macOS Sequoia, Sonoma, Ventura, and earlier versions.
Key Findings
System Settings Method (Permanent)
For macOS Ventura and later (including Sonoma and Sequoia):
- Click Apple menu → System Settings
- Select Energy (or Displays → Advanced)
- Toggle on “Prevent automatic sleeping when the display is off”
- Additionally, go to Lock Screen → Set “Turn display off when inactive” to Never
For macOS Monterey and earlier:
- Open System Preferences → Energy Saver
- Check “Prevent your Mac from automatically sleeping when the display is off”
Important Note: Preventing automatic sleeping when display is off won’t stop Mac from sleeping entirely. You must also adjust Lock Screen settings to fully prevent sleep mode.
caffeinate Command (Temporary)
The caffeinate command is a built-in macOS utility that temporarily prevents sleep without modifying system preferences. This is ideal for temporary use cases or on Macs you don’t own.
Basic Usage
caffeinateKeeps Mac awake until you press Ctrl+C or close Terminal.
Common Options
| Flag | Function |
|---|---|
caffeinate -i | Prevents idle sleeping |
caffeinate -d | Prevents display from sleeping |
caffeinate -m | Keeps disk awake at all times |
caffeinate -s | Prevents sleep only when plugged into power |
caffeinate -t X | Prevents sleep for X seconds |
Examples
# Prevent display sleep for 3 hours (10,800 seconds)caffeinate -dt 10800
# Prevent idle sleep indefinitelycaffeinate -i
# Prevent sleep only when on power adaptercaffeinate -sAdvantages of caffeinate
- Temporary: Automatically stops when Terminal closes
- No settings changes: Doesn’t require modifying System Settings
- Flexible: Time-based or flag-based control
- Safe for shared Macs: No need to remember to change settings back
Mac Studio Specific Notes
Mac Studio is designed to run 24/7 as a desktop workstation. Some users successfully keep their Mac Studio running continuously with proper settings configured. The M1/M2/M3 Mac Studio models all support the same sleep prevention methods.
Use Cases
- Long-running tasks: Video rendering, compilation, downloads
- Server/always-on usage: Running services or remote access
- Presentations: Preventing sleep during demos
- Temporary needs: Using caffeinate for one-time scenarios
Sources
- Set sleep and wake settings for your Mac - Apple Support
- How to stop Mac from sleeping: 7 methods - Setapp
- How to Stop Your Mac From Sleeping When the Display is Off - MacRumors
- How to stop your Mac sleeping using the ‘caffeinate’ command - Tom’s Guide
- Caffeinate Your Mac - The Apple Geek
- Change Energy settings on a Mac desktop computer - Apple Support