重建 Kexts 缓存命令

sudo rm /System/Library/PrelinkedKernels/prelinkedkernel
sudo rm /System/Library/Caches/com.apple.kext.caches/Startup/kernelcache
sudo chmod -R 755 /System/Library/Extensions
sudo chmod -R 755 /Library/Extensions
sudo chown -R root:wheel /System/Library/Extensions
sudo chown -R root:wheel /Library/Extensions
sudo touch /System/Library/Extensions
sudo touch /Library/Extensions
sudo kextcache -q -update-volume /
sudo kextcache -system-caches
sudo kextcache -i /

允许安装任何来源软件

sudo spctl --master-disable

Finder 显示隐藏文件

defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

设置界面去除数字小红点

defaults write com.apple.systempreferences AttentionPrefBundleIDs 0

挂载 EFI 分区

dev=$(diskutil list|grep "1:                        EFI"|grep EFI|awk '{print $6}')
echo 'password'|sudo -S mount -t msdos /dev/$dev /Volumes/EFI

取消4位数密码限制

pwpolicy -clearaccountpolicies

开启HIDPI

sh -c "$(curl -fsSL https://raw.githubusercontent.com/xzhih/one-key-hidpi/master/hidpi.sh)"

睡眠优化代码

sudo pmset -a hibernatemode 0
sudo rm -rf /var/vm/sleepimage
sudo mkdir /var/vm/sleepimage
sudo pmset -a standby 0
sudo pmset -a autopoweroff 0
sudo pmset -a proximitywake 0

Catalina挂载系统分区

sudo -S mount -uw / && killall Finder

查看睡眠时间

sysctl -a |grep sleeptime

查看睡眠唤醒时间

sysctl -a |grep waketime

查看最近24小时睡眠唤醒原因

log show --last 24h | grep "Wake reason"

查看睡眠唤醒详情

pmset -g log | grep -Ei 'wake.*due'
Last modification:March 26, 2020
If you think my article is useful to you, please feel free to appreciate