Closed cyclism6486 closed 4 years ago
You can compile command line version of SMCUtil
from https://github.com/sicreative/BatteryStatusShow and run sudo SMCUtil -w BCLM <hex val>
. Works as far back as 10.9 (probably even further, as it just needs the smc key to be defined).
If you want a slightly easier way, I built a quick wrapper around that same utility in the form of an Alfred workflow that lets you set charging level to either 70% or 100% cap.
It's here, midway down below the Alfred screenshot https://www.alexwhittemore.com/controlling-macbook-pro-charging-cap-with-alfred/
@krackers you can also take the easy route and just download it pre-compiled, which is what I did for that Alfred workflow :) https://github.com/sicreative/BatteryStatusShow/tree/master/BatteryStatusShow/smcutil/Products/usr/local/bin
@krackers - just because I figured out how to leave an "issue" here doesn't mean I'm a developer. Last time I used a compiler was with Fortran 77, so I have no idea how to do what you said. @alexwhittemore - I will take a look at that Alfred workflow....but first I need to install Alfred.
Thanks for the tips everybody. I decided to create a small utility using Script Editor to set the max charge level using smcutil
. It should run on almost all versions of macOS, though it was specifically tested on my MacBook Pro 13" (early 2015) with macOS Mojave 10.14.6.
@alexwhittemore Nice work! I believe the pre-compiled binary uses the os_unfair_lock
symbol which was only defined in 10.12+.
To build for older platforms it should be safe to replace this with the commented out variant (OSSpinLock
). I haven't done enough kernel development to be sure of the difference but I think the switch to unfair_lock was just a performance optimization – since we're not calling it repeatedly it should be fine.
Hi guys!
Since I developed and compiled this tool on Catalina, I was not able to test if it works for other versions of MacOS. I am sad to hear that it apparently does not.
Also @alexwhittemore congrats on your Alfred workflow, it seems to be very handy and convenient!
Best regards, David
when I open the DMG on my laptops running Mojave I see the dreaded "circle with line" over the app's icon. I really wanted this to work for Mojave since I don't plan on going to Catalina until next September. Maybe update the readme to state "requires macOS 10.15.x"