Skip to content

Instantly share code, notes, and snippets.

@mightbxg
Created September 22, 2021 03:44
Show Gist options
  • Save mightbxg/dffae219f1f1cf45bfd08c5e9246240d to your computer and use it in GitHub Desktop.
Save mightbxg/dffae219f1f1cf45bfd08c5e9246240d to your computer and use it in GitHub Desktop.
Enable high performance mode for android mobile phone through adb
#! /bin/bash
adb wait-for-device
adb root
adb wait-for-device
adb shell "setprop persist.sys.enable.hypnus 0"
adb shell "rmmod hypnus"
adb shell stop thermal-engine
adb shell stop perfd
adb shell stop logd
adb shell stop perf-hal-1-0
adb shell stop perf-hal-2-0
adb shell "echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/max_cpus"
adb shell "echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus"
adb shell "echo 3 > /sys/devices/system/cpu/cpu4/core_ctl/max_cpus"
adb shell "echo 3 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus"
adb shell "echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/max_cpus"
adb shell "echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/min_cpus"
adb shell "echo 1 > /sys/module/lpm_levels/parameters/sleep_disabled"
adb shell "echo 1 > /sys/devices/system/cpu/cpu0/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu1/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu2/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu3/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu4/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu5/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu6/online"
adb shell "echo 1 > /sys/devices/system/cpu/cpu7/online"
adb shell "chmod 666 /sys/devices/system/cpu/cpu*/isolate"
adb shell "echo 0 > /sys/devices/system/cpu/cpu0/isolate"
adb shell "echo 0 > /sys/devices/system/cpu/cpu1/isolate"
adb shell "echo 0 > /sys/devices/system/cpu/cpu2/isolate"
adb shell "echo 0 > /sys/devices/system/cpu/cpu3/isolate"
adb shell "echo 0 > /sys/devices/system/cpu/cpu4/isolate"
adb shell "echo 0 > /sys/devices/system/cpu/cpu5/isolate"
adb shell "echo 0 > /sys/devices/system/cpu/cpu6/isolate"
adb shell "echo 0 > /sys/devices/system/cpu/cpu7/isolate"
adb shell "echo performance > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
adb shell "echo performance > /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu-cpu-llcc-bw/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu-llcc-ddr-bw/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu0-cpu-l3-lat/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu0-cpu-llcc-lat/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu0-llcc-ddr-lat/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu4-cpu-ddr-latfloor/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu4-cpu-l3-lat/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu4-cpu-llcc-lat/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu4-llcc-ddr-lat/governor"
adb shell "echo performance > /sys/class/devfreq/soc:qcom,cpu7-cpu-l3-lat/governor"
adb shell "echo 0 > /sys/class/mmc_host/mmc0/clk_scaling/enable"
adb shell "echo 0 > /sys/class/scsi_host/host0/../../../clkscale_enable"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment