Your Mac fell asleep halfway through a 40 GB download. Or the remote session dropped, or the screen went dark mid-demo. Someone tells you to get the Amphetamine app for Mac, and they're right: it's free, it has sat in the Mac App Store since 2014, and it offers more ways to decide when your Mac stays awake than most people need.
It also runs on machinery macOS gives you for free. Knowing which setting maps to which piece tells you when you need the app, when one Terminal command will do, and why the usual keep-awake switch gives up when you close the lid.
Short answer: Amphetamine is a free menu bar app by William Gustafson that keeps your Mac — and optionally its display — awake on demand, on a timer, while a file downloads or an app runs, or automatically through rule-based Triggers. Install it from the Mac App Store; it needs macOS 10.13 or later, and the current version is 5.3.2, released November 2023. For a one-off job, the built-in caffeinate command does the core work. Amphetamine earns its place with Triggers and its closed-lid mode.
What Amphetamine for Mac is, and who maintains it
Amphetamine is a sandboxed Mac App Store utility from an independent developer, William Gustafson. The App Store listing (checked October 2026) is plain about money: free, with no ads, no in-app purchases, no paid tier and no tracking.
Two things the listing doesn't put up front.
The last release is from November 2023. Apple's App Store lookup API reports version 5.3.2, released November 10, 2023. The first release was November 2014.
Those 5.3.2 notes fix a Sonoma crash. Apple has since shipped Sequoia, Tahoe and macOS 27 — see the version picker in Apple's Mac User Guide. That doesn't make the app broken, but nothing those systems changed has been addressed in a release.
The name nearly got it pulled. In December 2020 Apple told Gustafson the name and pill icon appeared "to promote inappropriate use of controlled substances" and set a January 12, 2021 deadline. On January 2, 2021, by his account, Apple accepted that both were used "metaphorically" and in a "medical sense." The app kept its name.
Sessions and Triggers: how the Amphetamine app keeps your Mac awake
A session is the manual mode. From the menu bar you start one that runs indefinitely, for a set duration, until a clock time, while a file downloads, or while a chosen app is running. Inside a session you decide whether display sleep, the screen saver, sleep with the built-in display closed, automatic cursor movement and screen locking are allowed (App Store listing).
A Trigger starts a session by itself when its conditions are met. The criteria on the listing fall into five groups:
- Displays: an external display connected, or the display being mirrored.
- Devices: a USB or Bluetooth device connected, a drive or volume mounted, headphones or another audio output in use.
- Power: the battery charging or above a threshold, the power adapter connected or disconnected.
- Network: a specific IP address, Wi-Fi network or DNS server, or a Cisco AnyConnect VPN connection.
- Apps and load: an app running, an app running and frontmost, CPU use past a threshold, the Mac idle past a threshold.
This is what macOS doesn't match. The Shortcuts automations added in macOS 26 fire at a moment — a display connects, the Mac joins a Wi-Fi network, a charger is plugged in. Amphetamine's criteria are "while" conditions: the session lasts as long as the condition holds.
The version history also mentions a Schedule criterion, and fixes a bug that blocked adding more than one criterion to a Trigger.
One sandbox limit: the app-running criterion only sees what the sandbox lets it see. Since 5.3, a Process Discovery script, installed from the (?) button in the While App Is Running menu, lets Amphetamine see more processes on Apple Silicon (release notes). Before 5.3 that needed a separate helper, Amphetamine Enhancer.
Does Amphetamine work with the lid closed?
Yes — that's Closed-Display Mode, the session option that blocks sleep when the built-in display is shut. On Apple Silicon there's a catch: per the release notes, plugging in or unplugging power mid-session could break it. 5.3 added a fix script that needed Touch ID or an admin password; 5.3.1 removed the prompt. That add-on, Amphetamine Power Protect, ships separately on GitHub because, as its install page explains, Apple won't let Amphetamine install it directly.
What Power Protect installs is more concrete than the name. The configuration file in the developer's published files is a sudoers rule letting any admin account run exactly two commands without a password: pmset -a disablesleep 1 and its undo, pmset -a disablesleep 0. The script's comments say turning Power Protect on means disabling sleep while the built-in display is closed.
disablesleep isn't in Apple's pmset man page; its state shows as SleepDisabled in pmset -g. The makers of two competing lid-closed apps, Sleepless and Clamshell, say it keeps a closed MacBook awake on battery too. Apple's documentation doesn't mention it.
Amphetamine Enhancer, the other add-on in search results, is older. Per its README it was a notarized, open-source helper that added a closed-display fail-safe and let Triggers see every running process — something a sandboxed app can't list on its own. Its repository was last updated in July 2020 (GitHub).
On Apple Silicon today, process monitoring is built in and closed-lid reliability goes through Power Protect.
Apple's supported route needs no app. A Mac laptop with its lid closed keeps driving an external display as long as it's "connected to power and using an external keyboard and mouse" (Apple Support). I walked through MacBook clamshell mode for long-running jobs in an earlier post.
Do you need Amphetamine at all?
If you want "stay awake when X happens" automation, or a lid-closed mode with a menu bar switch, yes. For a one-off, macOS already has the tool:
| You need | Simplest tool | Closest Amphetamine feature |
|---|---|---|
| Stay awake until a command finishes | caffeinate -i ./long-job.sh |
While app is running |
| Stay awake until a running process quits | caffeinate -i -w <pid> |
While app is running |
| Stay awake for the next two hours | caffeinate -i -t 7200 |
Timed session |
| Keep the screen on for slides or a dashboard | caffeinate -d |
Session with display sleep off |
| Keep an external drive from idling | caffeinate -m |
Drive Alive |
| Never idle-sleep while plugged in | System Settings → Battery → Options → "Prevent automatic sleeping on power adapter when the display is off" | — |
| Stay awake while an SSH session is in use | Often nothing: check ttyskeepawake in pmset -g |
— |
| Stay awake on a dock, a Wi-Fi network, a VPN, a charger | An Amphetamine Trigger | Trigger |
| Lid closed with external display, keyboard, mouse and power | Nothing — Apple's closed-display mode | — |
| Lid closed with no external display | Amphetamine Closed-Display Mode (plus Power Protect on Apple Silicon), or by hand sudo pmset -a disablesleep 1 |
Closed-Display Mode |
Browser downloads are the one session type with no neat one-liner, since there's no command to wrap.
Two notes on the table. The Battery path is from Apple's sleep and wake guide; desktop Macs have the same switch under Energy. And ttyskeepawake holds off idle sleep while a remote login session is active, per the pmset man page — it was 1 on the macOS 26.7 MacBook I checked.
What each option holds, in macOS's own terms
Amphetamine, like caffeinate, works by holding power assertions — named requests that tell macOS not to sleep; its 5.3.2 notes describe work on "creating and releasing power assertions" (App Store). pmset lists every assertion with the process holding it, and caffeinate creates them from Terminal (man page). I ran each flag on macOS 26.7 and read back what it created with pmset -g assertions:
| Flag | Assertion it creates | What it holds off | What it can't stop |
|---|---|---|---|
none, or -i |
PreventUserIdleSystemSleep | Idle sleep; the display can still sleep | Lid close, Apple menu sleep, low battery |
-d |
PreventUserIdleDisplaySleep | Display sleep, and with it idle sleep | Lid close |
-m |
PreventDiskIdle | Disks idling | System sleep |
-s |
PreventSystemSleep | System sleep, on AC power only | Anything on battery |
-u |
UserIsActive | Turns the display on; 5 seconds unless -t says otherwise |
— |
Apple is the source for that last column: IOPMLib.h, the header that defines these assertions, covers the first three rows; the caffeinate man page covers -s. Here's the real entry caffeinate -i -t 5 produced (excerpt: the system-wide summary and other processes removed):
$ caffeinate -i -t 5 &
$ pmset -g assertions
pid 78373(caffeinate): [0x001a50d600019830] 00:00:01 PreventUserIdleSystemSleep named: "caffeinate command-line tool"
Details: caffeinate asserting for 5 secs
Localized=THE CAFFEINATE TOOL IS PREVENTING SLEEP.
Timeout will fire in 4 secs Action=TimeoutActionRelease
Run the same command during an Amphetamine session and you'll see what your chosen options hold; each line names its owner. It's also the quickest answer to "what's keeping my Mac awake?" — plain pmset -g prints sleep prevented by followed by the process names.
The lid is where people get stuck. For the idle-sleep assertion that caffeinate takes by default and with -i, Apple's header says the system "may still sleep for lid close, Apple menu, low battery, or other sleep reasons." That's why caffeinate and KeepingYouAwake, which wraps it and says outright it can't keep a closed MacBook awake, stop at the lid. Closing the lid takes Apple's external-display setup or a lid-sleep override.
Is Amphetamine safe?
As Mac utilities go, the Amphetamine Mac app is well contained. Mac App Store apps run sandboxed — the reason Enhancer exists at all (Enhancer README). The developer's privacy label on the App Store lists only diagnostics, not linked to you.
The three add-ons that work outside the sandbox are all opt-in and published on GitHub: Enhancer, MIT-licensed and notarized by Apple; the Process Discovery script, which lets Triggers see more processes; and Power Protect, a script plus a sudoers file covering just those two pmset commands.
The realistic risk is a forgotten session holding off sleep on battery. Amphetamine can end sessions when the battery runs low — turn that on. If you stop using Closed-Display Mode, Feedback & Support → Uninstall Scripts… in its menu removes its scripts.
Where Timex fits
I build Timex, a time tracker for Mac, and it has a Stay Awake toggle, so here's the fair comparison. Stay Awake is one switch. It holds off idle sleep the way caffeinate -i does until you turn it off, survives relaunches and is released when you quit. The display still sleeps and the screen still locks. Plugged in with the lid closed, the Mac keeps running; on battery with the lid closed, macOS puts it to sleep anyway. It's a switch, not a rules engine.
I shipped it to fix my own problem — long local-model runs stalling because the Mac slept — and I wanted the switch next to the tracker that shows whether the run kept going. That's what tracking time on local LLM runs is about. Stay Awake is free in Timex forever. But if all you want is a Mac that stays awake, Amphetamine is free and does far more. Timex needs macOS 15 or later on Apple Silicon, and it's only worth installing for the tracker.
The honest caveats
I haven't tested Closed-Display Mode for this article. Everything here about it comes from the developer's release notes and published files.
disablesleep is undocumented. If you set it by hand, undo it with sudo pmset -a disablesleep 0 when the job is done.
An app without releases ages quietly. 5.3.2 is almost three years old. If a macOS update breaks a Trigger, no fix has shipped.
A closed lid traps heat. A heavy job with the lid shut runs with less airflow, as the Sleepless FAQ notes, and Clamshell's guide warns against running one in a bag or sleeve. Keep it on a desk.
So, install it?
If you want a Mac that decides by itself when to stay awake, yes — nothing built into macOS ties staying awake to a display, a network or a charger the way a Trigger does, and Amphetamine costs nothing. If you need it once a week for a download, caffeinate -i in a Terminal tab is one less app to install.
And if you'd also like to know where your hours went while the Mac stayed up, Download Timex. The 100-hour trial covers the tracking; Stay Awake stays free either way.
— DK