💻 MacBook Battery Drain While in Sleep (Actually) SOLVED!
If you have issues with battery drain while sleeping this is because, your mac wake while you closing your lid, and you don't know that!!
First, make sure to track sleep and wake requests from this command in the terminal:
pmset -g log | grep -e "Wake from" -e "DarkWake" -e "Sleep" -e "Wake"
After that, take the log, and go to ChatGPT and tell him to analyse this log for you, the most important thing is to tell him to select what wakes the mac when sleeping, and if you fine any thing related to CSPNEvaluation, Congratulations 🙌 🥂 This guild will solve your issue.
1- CSPNEvaluation FIX
I discovered that macOS has a FeatureFlag for enabling CoreSmartPowerNap
in the powerd.plist
file.
🔍 Original path:
/System/Library/FeatureFlags/Domain/powerd.plist
✨ New path (override here):
/Library/Preferences/FeatureFlags/Domain/powerd.plist
🎙️ You can’t modify the plist file in the original path because it’s protected by the Secure System Volume (SSV).
But macOS allows overriding FeatureFlags by placing your custom plist in the new path above.
Since I applied this method, I haven’t seen any CSPNEvaluation
wake reasons!
👉🏻 Do the following steps:
- Open Terminal
- Create the folder structure:
sudo mkdir -p /Library/Preferences/FeatureFlags/Domain/
- Follow the steps shown in the video.
- Reboot your Mac.
🔋 Tried and tested:
- Let the machine sleep for 1 day 😴
- Wake it up.
- Run:
pmset -g log > pmset.txt
- Result: No
CSPNEvaluation
Wake Request for this sleep cycle! 😃
2- Auto Scheduling events FIX
📍 Prevent the system from rescheduling events:
Apple sometimes triggers auto wake events from files like:
com.apple.calaccessd.plist
com.apple.calaccessd.travelEngine.periodicRefreshTimer
Lock them using:
sudo chflags schg /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
‼️ Note: This locks the file and prevents any system updates to it.
To unlock it later, use:
sudo chflags noschg /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
3- Other Battery Drain FIXs
This Recommended pmset
commands to optimize sleep:
sudo pmset -a bluetoothpower 0
sudo pmset -a tcpkeepalive 0
sudo pmset -a powernap 0
sudo pmset -a darkwakes 0
sudo pmset -a proximitywake 0
sudo pmset -a ttyskeepawake 0
sudo pmset -a autopoweroff 1
sudo pmset -a autopoweroffdelay 3700
sudo pmset -a standby 1
sudo pmset -a standbydelaylow 1800 standbydelayhigh 3600
sudo pmset -a hibernatemode 25 # Makes wake-up ~8 secs slower
hibernatemode 25:
This cut the power from your RAM and stores the device status on the desk.
Flags meaning:
-a
: all power sources-b
: battery-c
: charger (wall power)-u
: UPS
🔄 Reset all pmset
settings:
sudo pmset restoredefaults
🔍 View current settings:
pmset -g custom
🔎 See wake reasons:
log show --last boot --style syslog | fgrep "Wake reason"
🔧 Other helpful commands:
pmset -g log | grep -e "Wake from" -e "DarkWake"
pmset -g log | grep "Wake Requests"
pmset -g log | grep "Wake Reason"
syslog | grep "Wake reason"
pmset -g log | grep -e " Sleep " -e " Wake "
💬 Have an issue?
Leave a comment below and let’s troubleshoot it together!