-
Boot into recovery using
⌘R
during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS -
Initial installation will run for approximately 1 hour, and reboot once
-
It will then show a remaining time of about 10-15 minutes
-
When it reboots again, be sure to press
⌘R
to boot into recovery and continue with Main procedure
Boot to Recovery Mode by holding ⌘R
during restart and continue with Main procedure
- Disable SIP (System Integrity Protection), then reboot
Open Utilities
→ Terminal
and type:
$ csrutil disable
$ reboot
-
Hold
⌘R
during the reboot to enter Recovery Mode again -
Enter
Disk Utility
, unmount and remount theMacintosh HD
volume (or whatever your main volume is named) to make it writable (it was mounted as read-only in Recovery Mode by default). -
Disable
Signed System Volume
, otherwise all the changes will lost after a reboot
Exit Disk Utility
, open Utilities
→ Terminal
, and type:
$ csrutil authenticated-root disable
- Backup & remove MDM related launch daemons & agents
$ cd "/Volume/Macintosh HD/System/Library"
$ mkdir LaunchDaemons.disabled LaunchAgents.disabled
$ mv LaunchDaemons/com.apple.ManagedClient* LaunchDaemons.disabled/
$ mv LaunchDaemons/com.apple.mdm* LaunchDaemons.disabled/
$ mv LaunchAgents/com.apple.ManagedClient* LaunchAgents.disabled/
$ mv LaunchAgents/com.apple.mdm* LaunchAgents.disabled/
- Blacklist MDM & DEP related domains
$ cd ../../etc
$ echo "0.0.0.0 iprofiles.apple.com" >> hosts
$ echo "0.0.0.0 mdmenrollment.apple.com" >> hosts
$ echo "0.0.0.0 deviceenrollment.apple.com" >> hosts
$ echo "0.0.0.0 gdmf.apple.com" >> hosts
The etc
folder might be missing in a fresh installation, just create a new one with mkdir etc
if this is your case.
- Take a new snapshot of the modified
/System
volume, otherwise you won't be able to boot.
$ bless --folder "/Volume/Macintosh HD/System/Library/CoreServices" --bootefi --create-snapshot
- Re-enable SIP (optional), then reboot normally
$ csrutil enable
$ reboot
-
If you come to the “Choose your country/location” dialogue, make sure to not select a wireless network, but “continue without an internet connection”
-
After a normal boot, you can verify the DEP status in Terminal:
$ profiles status -type enrollment
Enrolled via DEP: No
MDM enrollment: No