牙叔教程 简单易懂
效果
功能介绍
计算RAM利用率
CPU运行频率
CPU和GPU温度
计算1秒内流量
手机信号
环境
手机: Mi 11 Pro
Android版本: 11
Autojs版本: 9.0.10
备注
只在小米11pro测试通过, 其他手机不一定能用, 代码仅供参考
温度这个吃不准, 百度了很多, 也没个准信, 就选了疑似参数
手机信号时有时无, , 多计算几次就可以了, 不同手机计算方式不一样
/sys/class/thermal下的文件信息
[ { fileName: ‘cooling_device0’, type: ‘thermal-cpufreq-0’ }, { fileName: ‘cooling_device1’, type: ‘thermal-cpufreq-4’ }, { fileName: ‘cooling_device10’, type: ‘cpu-hotplug3’ }, { fileName: ‘cooling_device11’, type: ‘cpu-isolate4’ }, { fileName: ‘cooling_device12’, type: ‘cpu-isolate5’ }, { fileName: ‘cooling_device13’, type: ‘cpu-isolate6’ }, { fileName: ‘cooling_device14’, type: ‘cpu-hotplug4’ }, { fileName: ‘cooling_device15’, type: ‘cpu-isolate7’ }, { fileName: ‘cooling_device16’, type: ‘cpu-hotplug5’ }, { fileName: ‘cooling_device17’, type: ‘cpu-hotplug6’ }, { fileName: ‘cooling_device18’, type: ‘cpu-hotplug7’ }, { fileName: ‘cooling_device19’, type: ‘thermal-cluster-7-4’ }, { fileName: ‘cooling_device2’, type: ‘thermal-cpufreq-7’ }, { fileName: ‘cooling_device20’, type: ‘thermal-devfreq-0’ }, { fileName: ‘cooling_device21’, type: ‘ddr-cdev’ }, { fileName: ‘cooling_device22’, type: ‘panel0-backlight’ }, { fileName: ‘cooling_device23’, type: ‘brightness0-clone’ }, { fileName: ‘cooling_device24’, type: ‘cdsp_hw’ }, { fileName: ‘cooling_device25’, type: ‘cdsp’ }, { fileName: ‘cooling_device26’, type: ‘battery’ }, { fileName: ‘cooling_device27’, type: ‘modem_pa’ }, { fileName: ‘cooling_device28’, type: ‘modem_pa_fr1’ }, { fileName: ‘cooling_device29’, type: ‘modem_tj’ }, { fileName: ‘cooling_device3’, type: ‘cpu-isolate0’ }, { fileName: ‘cooling_device30’, type: ‘modem_bcl’ }, { fileName: ‘cooling_device31’, type: ‘modem_charge_state’ }, { fileName: ‘cooling_device32’, type: ‘modem_skin’ }, { fileName: ‘cooling_device33’, type: ‘modem_mmw0’ }, { fileName: ‘cooling_device34’, type: ‘modem_mmw1’ }, { fileName: ‘cooling_device35’, type: ‘modem_mmw2’ }, { fileName: ‘cooling_device36’, type: ‘modem_mmw3’ }, { fileName: ‘cooling_device37’, type: ‘modem_mmw_skin0’ }, { fileName: ‘cooling_device38’, type: ‘modem_mmw_skin1’ }, { fileName: ‘cooling_device39’, type: ‘modem_mmw_skin2’ }, { fileName: ‘cooling_device4’, type: ‘cpu-isolate1’ }, { fileName: ‘cooling_device40’, type: ‘modem_mmw_skin3’ }, { fileName: ‘cooling_device41’, type: ‘modem_mmw_skin0_dsc’ }, { fileName: ‘cooling_device42’, type: ‘modem_mmw_skin1_dsc’ }, { fileName: ‘cooling_device43’, type: ‘modem_mmw_skin2_dsc’ }, { fileName: ‘cooling_device44’, type: ‘modem_mmw_skin3_dsc’ }, { fileName: ‘cooling_device45’, type: ‘modem_wlan’ }, { fileName: ‘cooling_device46’, type: ‘modem_skin_lte_dsc’ }, { fileName: ‘cooling_device47’, type: ‘modem_skin_nr_dsc’ }, { fileName: ‘cooling_device48’, type: ‘modem_pa_dsc’ }, { fileName: ‘cooling_device49’, type: ‘modem_pa_fr1_dsc’ }, { fileName: ‘cooling_device5’, type: ‘cpu-isolate2’ }, { fileName: ‘cooling_device6’, type: ‘cpu-isolate3’ }, { fileName: ‘cooling_device7’, type: ‘cpu-hotplug0’ }, { fileName: ‘cooling_device8’, type: ‘cpu-hotplug1’ }, { fileName: ‘cooling_device9’, type: ‘cpu-hotplug2’ }, { fileName: ‘thermal_zone0’, type: ‘pa_therm0’ }, { fileName: ‘thermal_zone1’, type: ‘pa_therm1’ }, { fileName: ‘thermal_zone10’, type: ‘modem-mmw0-mod-usr’ }, { fileName: ‘thermal_zone11’, type: ‘modem-mmw1-mod-usr’ }, { fileName: ‘thermal_zone12’, type: ‘modem-mmw2-mod-usr’ }, { fileName: ‘thermal_zone13’, type: ‘modem-mmw3-mod-usr’ }, { fileName: ‘thermal_zone14’, type: ‘modem-mmw-pa1-usr’ }, { fileName: ‘thermal_zone15’, type: ‘modem-mmw-pa2-usr’ }, { fileName: ‘thermal_zone16’, type: ‘modem-mmw-pa3-usr’ }, { fileName: ‘thermal_zone17’, type: ‘modem-sdr-mmw-usr’ }, { fileName: ‘thermal_zone18’, type: ‘mdmss-1-step’ }, { fileName: ‘thermal_zone19’, type: ‘mdmss-2-step’ }, { fileName: ‘thermal_zone2’, type: ‘modem-mmw0-usr’ }, { fileName: ‘thermal_zone20’, type: ‘aoss-0-usr’ }, { fileName: ‘thermal_zone21’, type: ‘cpu-0-0-usr’ }, { fileName: ‘thermal_zone22’, type: ‘cpu-0-1-usr’ }, { fileName: ‘thermal_zone23’, type: ‘cpu-0-2-usr’ }, { fileName: ‘thermal_zone24’, type: ‘cpu-0-3-usr’ }, { fileName: ‘thermal_zone25’, type: ‘cpuss-0-usr’ }, { fileName: ‘thermal_zone26’, type: ‘cpuss-1-usr’ }, { fileName: ‘thermal_zone27’, type: ‘cpu-1-0-usr’ }, { fileName: ‘thermal_zone28’, type: ‘cpu-1-1-usr’ }, { fileName: ‘thermal_zone29’, type: ‘cpu-1-2-usr’ }, { fileName: ‘thermal_zone3’, type: ‘modem-mmw1-usr’ }, { fileName: ‘thermal_zone30’, type: ‘cpu-1-3-usr’ }, { fileName: ‘thermal_zone31’, type: ‘cpu-1-4-usr’ }, { fileName: ‘thermal_zone32’, type: ‘cpu-1-5-usr’ }, { fileName: ‘thermal_zone33’, type: ‘cpu-1-6-usr’ }, { fileName: ‘thermal_zone34’, type: ‘cpu-1-7-usr’ }, { fileName: ‘thermal_zone35’, type: ‘aoss-1-usr’ }, { fileName: ‘thermal_zone36’, type: ‘gpuss-0-usr’ }, { fileName: ‘thermal_zone37’, type: ‘gpuss-1-usr’ }, { fileName: ‘thermal_zone38’, type: ‘nspss-0-usr’ }, { fileName: ‘thermal_zone39’, type: ‘nspss-1-usr’ }, { fileName: ‘thermal_zone4’, type: ‘modem-mmw2-usr’ }, { fileName: ‘thermal_zone40’, type: ‘nspss-2-usr’ }, { fileName: ‘thermal_zone41’, type: ‘video-usr’ }, { fileName: ‘thermal_zone42’, type: ‘ddr-usr’ }, { fileName: ‘thermal_zone43’, type: ‘mdmss-0-usr’ }, { fileName: ‘thermal_zone44’, type: ‘mdmss-1-usr’ }, { fileName: ‘thermal_zone45’, type: ‘mdmss-2-usr’ }, { fileName: ‘thermal_zone46’, type: ‘mdmss-3-usr’ }, { fileName: ‘thermal_zone47’, type: ‘camera-0-usr’ }, { fileName: ‘thermal_zone48’, type: ‘camera-1-usr’ }, { fileName: ‘thermal_zone49’, type: ‘pop-mem-step’ }, { fileName: ‘thermal_zone5’, type: ‘modem-mmw3-usr’ }, { fileName: ‘thermal_zone50’, type: ‘cpu-0-0-step’ }, { fileName: ‘thermal_zone51’, type: ‘cpu-0-1-step’ }, { fileName: ‘thermal_zone52’, type: ‘cpu-0-2-step’ }, { fileName: ‘thermal_zone53’, type: ‘cpu-0-3-step’ }, { fileName: ‘thermal_zone54’, type: ‘cpu-1-0-step’ }, { fileName: ‘thermal_zone55’, type: ‘cpu-1-1-step’ }, { fileName: ‘thermal_zone56’, type: ‘cpu-1-2-step’ }, { fileName: ‘thermal_zone57’, type: ‘cpu-1-3-step’ }, { fileName: ‘thermal_zone58’, type: ‘cpu-1-4-step’ }, { fileName: ‘thermal_zone59’, type: ‘cpu-1-5-step’ }, { fileName: ‘thermal_zone6’, type: ‘modem-skin-usr’ }, { fileName: ‘thermal_zone60’, type: ‘cpu-1-6-step’ }, { fileName: ‘thermal_zone61’, type: ‘cpu-1-7-step’ }, { fileName: ‘thermal_zone62’, type: ‘gpuss-0-step’ }, { fileName: ‘thermal_zone63’, type: ‘gpuss-1-step’ }, { fileName: ‘thermal_zone64’, type: ‘nspss-0-step’ }, { fileName: ‘thermal_zone65’, type: ‘nspss-1-step’ }, { fileName: ‘thermal_zone66’, type: ‘nspss-2-step’ }, { fileName: ‘thermal_zone67’, type: ‘mx-pe-step’ }, { fileName: ‘thermal_zone68’, type: ‘cx-pe-step’ }, { fileName: ‘thermal_zone69’, type: ‘pm8350_tz’ }, { fileName: ‘thermal_zone7’, type: ‘modem-wifi-usr’ }, { fileName: ‘thermal_zone70’, type: ‘pm8350c_tz’ }, { fileName: ‘thermal_zone71’, type: ‘pm8350c-bcl-lvl0’ }, { fileName: ‘thermal_zone72’, type: ‘pm8350c-bcl-lvl1’ }, { fileName: ‘thermal_zone73’, type: ‘pm8350c-bcl-lvl2’ }, { fileName: ‘thermal_zone74’, type: ‘pm8350b_tz’ }, { fileName: ‘thermal_zone75’, type: ‘pm8350b-ibat-lvl0’ }, { fileName: ‘thermal_zone76’, type: ‘pm8350b-ibat-lvl1’ }, { fileName: ‘thermal_zone77’, type: ‘pm8350b-bcl-lvl0’ }, { fileName: ‘thermal_zone78’, type: ‘pm8350b-bcl-lvl1’ }, { fileName: ‘thermal_zone79’, type: ‘pm8350b-bcl-lvl2’ }, { fileName: ‘thermal_zone8’, type: ‘modem-ambient-usr’ }, { fileName: ‘thermal_zone80’, type: ‘socd’ }, { fileName: ‘thermal_zone81’, type: ‘pmr735a_tz’ }, { fileName: ‘thermal_zone82’, type: ‘pmr735b_tz’ }, { fileName: ‘thermal_zone83’, type: ‘xo-therm-step’ }, { fileName: ‘thermal_zone84’, type: ‘laser_therm0’ }, { fileName: ‘thermal_zone85’, type: ‘flash_therm’ }, { fileName: ‘thermal_zone86’, type: ‘charger_therm0’ }, { fileName: ‘thermal_zone87’, type: ‘quiet_therm’ }, { fileName: ‘thermal_zone88’, type: ‘wireless_therm’ }, { fileName: ‘thermal_zone89’, type: ‘wifi_therm’ }, { fileName: ‘thermal_zone9’, type: ‘modem-streamer-usr’ }, { fileName: ‘thermal_zone90’, type: ‘xo_therm’ }, { fileName: ‘thermal_zone91’, type: ‘vbat’ }, { fileName: ‘thermal_zone92’, type: ‘battery’ }, { fileName: ‘thermal_zone93’, type: ‘usb’ } ]
不同设备,/sys/class/thermal目录下的文件不一样,
温度便是读取某个文件的值, 获取温度的另外一种方式是注册广播,
那个就是异步了, 逻辑有点麻烦, 还是直接读取文件逻辑简单一些.
大家可以去应用市场, 下载一些查看手机信息的app, 然后对比一下,
网上获取gpu温度的资料还是很少的,google和stackoverflow都没个准的.
名人名言
思路是最重要的, 其他的百度, bing, stackoverflow, github, 安卓文档, autojs文档, 最后才是群里问问— 牙叔教程
声明
部分内容来自网络本教程仅用于学习, 禁止用于其他用途
bilibili
牙叔教程