macbook设置充电上限
针对 internal 芯片
参考
https://blog.csdn.net/happyyouli/article/details/115805747
直接使用make 可能会报错,改用cmake
git clone https://github.com/hholtmann/smcFanControl.git
cd smcFanControl/smc-command
添加 CMakeLists.txt
cmake_minimum_required (VERSION 3.11)
project(smc)
SET (CMAKE_EXE_LINKER_FLAGS "-framework IOKit")
add_definitions(-DCMD_TOOL_BUILD)
add_executable(smc "smc.c")
使用ninja 编译。
make dir build
cd build
cmake -G Ninja ../
ninja
也可以使用Xcode
make dir build
cd build
cmake -G Xcode ../
xcodebuild -project smc.xcodeproj -configuration Release
./smc -k BCLM -r (查看当前的设置)
sudo ./smc -k BCLM -w 4D,表示充电限制为77%,实际电量会停在80%
sudo ./smc -k BCLM -w 64 恢复100%