#!/bin/bash
echo "scaling_freq......."
adb wait-for-device
adb root
adb remount
for ((i=0;i<=5;i++));
do
echo "======================cpu[$i]======================"
echo "支持的频率:"
adb shell "cat /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_max_freq"
echo "当前频率:"
adb shell "cat /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_cur_freq"
done
echo ".....开始设置频率....."
adb shell "echo 2100000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
adb shell "echo 1600000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq"
adb shell "echo 1600000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq"
adb shell "echo 2100000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq"
adb shell "echo 2100000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq"
adb shell "echo 2100000 > /sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq"
adb shell "echo 2100000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"
adb shell "echo 1600000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq"
adb shell "echo 1600000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq"
adb shell "echo 2100000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq"
adb shell "echo 2100000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq"
adb shell "echo 2100000 > /sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq"
for ((i=0;i<=5;i++));
do
adb shell "echo performance > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_governor"
echo "======================cpu[$i]======================"
echo "当前频率:"
adb shell "cat /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_cur_freq"
echo "当前最小频率:"
adb shell "cat /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_min_freq"
echo "当前最大频率:"
adb shell "cat /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_max_freq"
done
强制给CPU调频/定频的方法
于 2023-01-28 07:08:56 首次发布