Skip to content

Instantly share code, notes, and snippets.

@corneliusroemer
Created December 20, 2019 22:08
Show Gist options
  • Save corneliusroemer/55c7494ae39a8a2a95cbe7647fea3038 to your computer and use it in GitHub Desktop.
Save corneliusroemer/55c7494ae39a8a2a95cbe7647fea3038 to your computer and use it in GitHub Desktop.
Get list and temperature of CPU and battery temperature sensors via Android Debug Bridge
#run from terminal with: adb shell "$(cat temperature.sh)" to get list of temperature sensors and their temperature
#on Android devices
for VARIABLE in $(seq 1 80)
do
cat /sys/devices/virtual/thermal/thermal_zone$VARIABLE/type
cat /sys/devices/virtual/thermal/thermal_zone$VARIABLE/temp
done
@cctsao1008
Copy link

cctsao1008 commented Aug 1, 2022

i=0; while [ $(($i)) -le 41 ]; do i=$(($i + 1)); paste -d /sys/devices/virtual/thermal/thermal_zone$i/type /sys/devices/virtual/thermal/thermal_zone$i/temp; done;

ibat-vhigh 160
vbat_adc 4212
vbat_low 4290
vbat_too_low 4251
soc 100
pm660-tz 37000
xo-therm-adc 53826
msm-therm-adc 54751
emmc-therm-adc 45828
pa-therm0-adc 53607
quiet-therm-adc 53557
quiet-therm-step 53557
aoss0-usr 63000
mdm-core-usr 59000
lpass-usr 57000
camera-usr 57000
cpuss1-usr 63000
apc1-cpu0-usr 63000
apc1-cpu1-usr 62000
apc1-cpu2-usr 64000
apc1-cpu3-usr 63000
cpuss0-usr 60000
gpu-usr 57000
gpu-step 58000
hexa-cpu-max-step 64000
apc1-cpu0-step 63000
apc1-cpu1-step 62000
apc1-cpu2-step 64000
apc1-cpu3-step 63000
aoss0-lowf 63000
mdm-core-lowf 59000
lpass-lowf 57000
camera-lowf 57000
cpuss1-lowf 62000
apc1-cpu0-lowf 63000
apc1-cpu1-lowf 62000
apc1-cpu2-lowf 64000
apc1-cpu3-lowf 63000
cpuss0-lowf 60000
gpu-lowf 57000
battery 47000
bms 47000

@Sappurit
Copy link

Sappurit commented Sep 29, 2022

Ref: https://www.kernel.org/doc/Documentation/thermal/sysfs-api.txt

for i in $(seq 0 12); do; h=`cat /sys/class/thermal/thermal_zone$i/type`; t=`cat /sys/class/thermal/thermal_zone$i/temp`; echo "$h|$t"; done;

@cctsao1008
Copy link

Ref: https://www.kernel.org/doc/Documentation/thermal/sysfs-api.txt

for i in $(seq 0 12); do; h=`cat /sys/class/thermal/thermal_zone$i/type`; t=`cat /sys/class/thermal/thermal_zone$i/temp`; echo "$h|$t"; done;

Got it. thank you very much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment