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
@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