Collection of Defaults
commands For modifying macOS default settings/behavior.
Collection of PMSET
commands to adjust Powwer Management (Standby, Sleep, Hibernation, etc.)
https://www.dssw.co.uk/reference/pmset.html
pmset -g
pmset -g log | grep -e "Sleep.*due to" -e "Wake.*due to"
Alternative Command (searches in syslog instead):
log show --style syslog | fgrep "Wake reason"
Fixes high CPU usage for Powerd
service in macOS Ventura beta 4
sudo pmset schedule cancelall
-
Disable:
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
-
Re-Enable:
launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write com.apple.ActivityMonitor ShowGPUTab -bool true
sw_vers
uname -r
system_profiler SPHardwareDataType | grep 'Model Identifier'
sudo spctl --master-disable
Important
In macOS Sequoia, Gatekeeper can no longer be disabled via Terminal (new method)
-
Disable Disk Image verification:
defaults write com.apple.frameworks.diskimages skip-verify TRUE
-
To Re-enable:
defaults write com.apple.frameworks.diskimages skip-verify FALSE
-
Unenroll from current seed:
sudo /System/Library/PrivateFrameworks/Seeding.framework/Resources/seedutil unenroll
-
Change seed:
sudo /System/Library/PrivateFrameworks/Seeding.framework/Resources/seedutil enroll DeveloperSeed
Note
In macOS 13+, switching update seeds via seedutil is no longer supported. Instead, registering your system in Apples beta program via Apple-ID is required. After that you can switch the updated seed in system sttings.
Brings back all the window pop-ups that ask for granting pernission to access periferals like microphones, webcams, etc.
tccutil reset All
setfile -a v ~/Library
chflags nohidden ~/Library
-
Show:
defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder
-
Hide:
defaults write com.apple.finder AppleShowAllFiles FALSE && killall Finder
Note
Alternatively, simply use this Keyboard Shortcut: ⌘⇧. (Command+Shift+Dot)
You can use this to fix the “Open with…” sub-menu (if it contains entries from apps that are no onger installed, etc.)
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
defaults write com.apple.finder "QuitMenuItem" -bool "true" && killall Finder
-
Disable:
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
-
Re-enable:
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool false
-
System-wide:
sudo mdutil -a -i off sudo mdutil -a -i on
-
For a specific volume:
sudo mdutil -i off /Volumes/Your Volume Name sudo mdutil -i on /Volumes/Your Volume Name
diskutil apfs list
Note
If you apply root patches with OCLP, the status of the entry Snapshot sealed
seal will change from Yes
to Broken
. But if you revert the root patches with OCLP prior to updating macOS, the seal will become intact again. And if the snapshot is sealed, incremental (or delta) OTA updates are available again so System Update won't download the complete installer!
sudo diskutil apfs updatePreboot /
sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool true
Note
This change is only temporary. Requires a Kernel Patch to make it persistant.
sudo update_dyld_shared_cache -force
sudo /usr/libexec/xpchelper --rebuild-cache
In Recovery, enter:
csrutil authenticated-root disable
bless --folder /Volumes/x/System/Library/CoreServices --bootefi --create-snapshot
x = name of your macOS Volume
defaults write com.apple.sidecar.display AllowAllDevices -bool true
defaults write com.apple.sidecar.display hasShownPref -bool true
Note
Requires Intel CPU with on-board graphics and is limited to specific SMBIOSes. It’s easier to enable it via FeatureUnlock.kext!
sudo rm /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo defaults write /Library/Preferences/com.apple.CoreDisplay useMetal -boolean no
sudo defaults write /Library/Preferences/com.apple.CoreDisplay useIOP -boolean no
or:
sudo defaults delete /Library/Preferences/com.apple.CoreDisplay useMetal
sudo defaults delete /Library/Preferences/com.apple.CoreDisplay useIOP
defaults write com.apple.iTunesHelper ignore-devices -bool YES
defaults write com.apple.AMPDeviceDiscoveryAgent ignore-devices 1
defaults write com.apple.AMPDeviceDiscoveryAgent reveal-devices 0
defaults write -g ignore-devices -bool true
Source: Apple-Knowledge
→ Check this guide for instructions.
networksetup -listallhardwareports
sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo rm /Library/Preferences/SystemConfiguration/preferences.plist
You really should disable IPv6 for security reasons, if you don't need it!
List all Network devices:
sudo networksetup -listallnetworkservices
Disable IPv6 for the following interfaces:
sudo networksetup -setv6off Ethernet
sudo networksetup -setv6off Wi-Fi
To re-enable:
sudo networksetup -setv6automatic Wi-Fi
sudo networksetup -setv6automatic Ethernet
sysctl -a | grep machdep.cpu.vendor
Doesn't really tell you much
sysctl -a | grep machdep.cpu.model
sysctl machdep.cpu.brand_string
sysctl -a | grep machdep.cpu.features
sysctl -a | grep freq
sysctl -a | grep machdep.cpu.leaf7_features
ioreg -rxn "CPU0@0"
Note
Text in quotation marks = CPU name as defined in ACPI. On Intel CPUs it can also be "PR00@0", "P000@0" or "C000@0". Check SSDT-PLUG
/SSDT-PM
to find the correct name.
log show --last boot
log show --last boot | grep "your search term"
Example: log show --last boot | grep "ACPI"
nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version
ioreg -l | grep -i board-id
or
`var_ID=$(ioreg -p IODeviceTree -r -n / -d 1 | grep board-id);var_ID=${var_ID##*<\"};var_ID=${var_ID%%\">};echo $var_ID`
pmset -g log | grep -e "Sleep.*due to" -e "Wake.*due to"
Alternative Command (searches in syslog instead):
log show --style syslog | fgrep "Wake reason"
nvram 7C436110-AB2A-4BBB-A880-FE41995C9F82:csr-active-config
csrutil status
xcode-select --install
kextstat | grep -v com.apple
sudo kextcache -U /
sudo kextcache -i /
- In Terminal, enter:
nvram 94b73556-2197-4702-82a8-3e1337dafbfb:AppleSecureBootPolicy
- Check the Results:
- if
%00
= No Security - if
%01
= Medium Security - if
%02
= Full Security
- if
Note
To achieve full securiity 02
additional measures are required.
chmod +x
(drag file in terminal, hit enter)
ioreg -l -p IOService -w0 | grep -i EHC1
ioreg -l -p IOService -w0 | grep -i EHC2
ioreg -l -p IOService -w0 | grep -i XHC1
ioreg -l -p IOService -w0 | grep -i XHCI
kextstat | grep -E "AppleSMBusController|AppleSMBusPCI"
Note
The search should return two matches: com.apple.driver.AppleSMBusController
and com.apple.driver.AppleSMBusPCI
. On modern Laptops, only AppleSMBusController may return in the search results!
log show --predicate "processID == 0" --start $(date "+%Y-%m-%d") --debug | grep "ACPI"
log show --last boot | grep AppleACPIPlatform
log show --last boot | grep AppleACPIPlatform > ~/Desktop/Log_"$(date '+%Y-%m-%d_%H-%M-%S')".log
The 2nd Command saves a log on the desktop.
Show hidden Files and Folders in Finder
⌘⇧. (Command+Shift+Dot)
defaults write -g ApplePressAndHoldEnabled -bool false
⌘⌥⌃T (Command+Option+Control+T)
cd ~/Desktop && mkdir CodecDump && for c in /proc/asound/card*/codec#*; do f="${c/\/*card/card}"; cat "$c" > CodecDump/${f//\//-}.txt; done && zip -r CodecDump.zip CodecDump
sudo dmesg|grep -i firmware