A Mac can work for CodeHero day and night: a local AI model, app builds, emulators. For that it must never sleep, it must not install a new macOS by itself, and after a restart it must log in, connect and work again with nobody at the Mac. These are the steps, each one in the Mac’s own System Settings. We tested them on 2026-11-19 with a MacBook Pro (Apple M5 Max, macOS 26.6), on its charger, the lid open.
What do you need first?
The Mac as a device in CodeHero, with SSH on.
- In CodeHero: Devices → + Device, system macOS.
- On the Mac: System Settings → General → Sharing → Remote Login ON.
The device join turns Remote Login on. Check that it is still on.
How do you keep a Mac from sleeping?
A MacBook: on its charger, with the lid open, and three settings.
- System Settings → Battery → Options → Prevent automatic sleeping on power adapter when the display is off ON.
- In the same window: Wake for network access → Always.
- System Settings → Lock Screen → turn the display off, on battery and on power adapter → Never.
Keep the lid open. A MacBook sleeps when its lid closes: on battery always; on power it stays awake only with an external display.
A Mac mini, Mac Studio or iMac (not tested by us: our test Mac is a MacBook): System Settings → Energy → Prevent automatic sleeping when the display is off ON, and Start up automatically after a power failure ON.
How do you stop macOS from installing updates by itself?
Turn the automatic macOS installs off. You install the updates yourself, when you choose.
- System Settings → General → Software Update.
- The (i) next to Automatic updates.
- Install macOS updates OFF.
Our test Mac also had the downloads and the security responses off. You may keep the security responses on: then an update can restart the Mac, and the steps here bring it back by itself.
Why turn FileVault off, and what does it cost?
With FileVault on, a restart stops at the unlock screen, and nothing works until a person types the password at the Mac. With FileVault off and automatic login on, the Mac comes back alone, but its disk is not encrypted.
At the unlock screen nobody is logged in: no VPN, no SSH, no emulators. For a Mac that must come back alone:
- System Settings → Privacy & Security → FileVault → Turn Off… (it asks for the Mac password).
- System Settings → Users & Groups → Automatically log in as → your user. macOS allows it only while FileVault is off.
The price, said plainly: the Mac’s disk is not encrypted, and anyone who has the Mac in their hands is logged in as you. Do it only on a Mac that is only for this work, in a place you trust. Otherwise keep FileVault on, and accept that after every restart someone must log in at the Mac.
How does the VPN come back by itself?
In the WireGuard app, turn On-Demand on for Wi-Fi and Ethernet.
- Open the WireGuard app (App Store) → the tunnel → Edit.
- On-Demand: tick Wi-Fi and Ethernet.
- Save.
On the same network as CodeHero (a Direct device) no VPN is needed.
How do you get the most speed for local AI models?
Set the Energy Mode to High Power on the power adapter. The temperature and the airflow are then yours to take care of.
- System Settings → Battery → Energy Mode → on power adapter: High Power.
A Mac mini or Mac Studio: System Settings → Energy → Energy Mode.
The fans run harder. You take care of the Mac’s temperature and its airflow: a free place, nothing on the vents. Want help with it? Ask a ticket or the assistant in CodeHero.
What if macOS asks to give sshd-keygen-wrapper access?
Click Don’t Allow. CodeHero needs none of it.
Over SSH, macOS may ask to give sshd-keygen-wrapper Accessibility, Automation, Full Disk Access or Screen Recording. Click Don’t Allow. A grant to it is a grant to every SSH session.
How do you know it works?
Restart the Mac and do not touch it. On our test Mac it logged in, connected and answered over SSH 35 seconds after the start.
- Apple menu → Restart.
- Do not touch the Mac.
| After the start | What you see |
|---|---|
| About 35 s | The Mac has logged in by itself. The VPN is connected. SSH works: the device’s Test connection in CodeHero answers. |
| About 46 s | An Android emulator that was running before the restart runs again: CodeHero starts the kept emulators at login. |
| — | The local AI model’s server does NOT start by itself. Start it from a ticket or the CodeHero panel. |
If the Mac waits for a password after the restart, check the FileVault step.
Does a locked screen stop the work?
No.
Lock it with ⌃⌘Q. On our test Mac the iOS simulator and the Android emulator started, showed their screens and streamed while the Mac was locked.