Documentation
Your computer
Keep your Mac awake
Your phone can only reach your computer while it's awake. A Mac laptop sleeps when you close its lid, and a sleeping Mac stops answering.
While a device is paired, the host keeps a running Mac from sleeping when it's idle. Closing the lid is different: that needs one more step.
Keep it awake with the lid closed#
repogo keep-awake enableThis asks for your password once and prints:
The host now keeps this Mac awake with the lid closed while a device is paired,
unless the Mac runs hot or its battery drops below 20%.From then on, the host keeps the Mac awake with its lid closed while a device is paired. It lets the Mac sleep anyway when it runs hot, or when it's on battery below 20%. Plugged in, it stays awake.
repogo keep-awake statusshows whether it's on.repogo keep-awake disableturns it off. The Mac sleeps when its lid closes again.
To do this, RepoGo adds one file, /etc/sudoers.d/repogo, that lets the host run pmset -a disablesleep and nothing else.
A closed Mac laptop still gets warm while it works. Keep it somewhere with airflow, not in a bag.
Check that it's on#
repogo keep-awake statusWhen it's working, you'll see:
Lid hold: enabled (/etc/sudoers.d/repogo)
SleepDisabled: 1, held by the host
Idle sleep is held while the host runs with a paired device.Lid hold: off: runrepogo keep-awake enable.SleepDisabled: 0with the lid hold enabled: the host is letting the Mac sleep right now, because no device is paired, the Mac is hot, or it's on battery below 20%. Plug it in.SleepDisabled: 1, set outside RepoGo: someone turned sleep off withsudo pmset -a disablesleep 1. The host leaves that setting alone, so the Mac never sleeps, even when it's hot or the battery is low. To let RepoGo manage it instead, runsudo pmset -a disablesleep 0, thenrepogo keep-awake enable.
The host holds the Mac awake only while it's running. If you quit it, the Mac sleeps as usual.
Why it still sleeps#
If your Mac drops offline even though you set it never to sleep, one of these is usually why:
- It's on battery. macOS keeps separate settings for battery and the power adapter. In System Settings → Battery → Options…, Prevent automatic sleeping on power adapter when the display is off applies only while it's plugged in.
- Disk sleep isn't Mac sleep. Setting Put hard disks to sleep when possible to Never keeps the disk awake; the Mac itself still sleeps.
- The lid is closed and
repogo keep-awake enablehasn't been run. A closed Mac laptop sleeps whatever the other settings say. - Low Power Mode (System Settings → Battery) makes it sleep sooner.
Once a Mac is asleep, your phone can't wake it. Wake for network access wakes it only for traffic on its own local network, not for a connection from your phone over the relay or Tailscale.
To see the settings for battery and the power adapter, run pmset -g custom. To see what's in effect right now and what's holding the Mac awake, run pmset -g.
After a restart#
On macOS the host starts when you log in. If your Mac restarts while you're away, for example after a software update, it waits at the login screen and the host doesn't run until someone logs in.
Automatic login avoids that, but macOS doesn't allow it while FileVault is turned on. Decide which matters more for that machine.