

sys/devices/platform/omap/omap_temp_sensor.0/temperature sys/devices/system/cpu/cpu0/cpufreq/FakeShmoo_cpu_temp The ones already listed as answer previously still hold true: /sys/devices/system/cpu/cpu0/cpufreq/cpu_temp sys/devices/platform/tegra-tsensor/tsensor_temperature These three locations are also used in addition to the one listed above: /sys/htc/cpu_temp There are so many different paths because different OEMs put the temperature in different places. Here is a current set of paths that are used in production in Dec 2019 to find CPU temperature. However in a pinch it's a quick and dirty way to get the job done. Looking at that path it's clear why you shouldn't do this and expect it to work on all devices - the paths and also the formats of the files will vary from device to device. These files also aren't just going to be for the CPU only - as an example the battery temperature sensor for my Google Glass can be accessed by reading /sys/devices/platform/omap_i2c.1/i2c-1/1-0055/power_supply/bq27520-0/temp. If you run adb shell and cd into that folder, you've got fairly good chances of find | grep temp giving you files representing temperature sensors. You can read off device files in /sys/devices/platform if you know where to look. Of course, that says nothing about doing it in a non-standard way which might be suitable for your application if it's not going for wide distribution. If a device doesn't expose CPU temperature via either temperature sensor (that is, asking for a sensor of type TEMPERATURE or AMBIENT_TEMPERATURE gives you nothing), you won't be able to read it in a standard manner. Here is the another way: Read system files

To read the file, I used: RandomAccessFile reader = new RandomAccessFile("/sys/devices/system/cpu/cpu0/cpufreq/cpu_temp", "r") "/sys/devices/platform/s5p-tmu/curr_temp" "/sys/devices/virtual/thermal/thermal_zone1/temp" "/sys/class/hwmon/hwmon0/device/temp1_input" "/sys/devices/virtual/thermal/thermal_zone0/temp" "/sys/devices/platform/s5p-tmu/temperature" "/sys/kernel/debug/tegra_thermal/temp_tj" "/sys/devices/platform/tegra_tmon/temp1_input" "/sys/devices/platform/omap/omap_temp_sensor.0/temperature" "/sys/devices/system/cpu/cpu0/cpufreq/FakeShmoo_cpu_temp" "/sys/devices/system/cpu/cpu0/cpufreq/cpu_temp" Read the file from following paths (Since it is different for different devices) to get cpu temperature details from different devices, One of the path will return the needed file.
