Sample Header Ad - 728x90

dumpsys battery in Termux

3 votes
1 answer
2333 views
I am trying to get battery info in Termux. I granted android.permission.DUMP and android.permission.PACKAGE_USAGE_STATS via ADB for com.termux (Termux app) Then I opened Termux and types in /system/bin/dumpsys battery. It displays this error message:
Can't find service: battery
and exits with code 0. I can confirm that I can get those info via ADB using the same command (e.g. getting battery level with /system/bin/dumpsys battery | grep level) Am I missing some permissions for Termux app? Or are there some more fixes? Please help. Edit: I am aware of the existence of termux-battery-status command in Termux. It's output is not too informative. So I will not accept answers telling me to use the command.
Asked by sudoer (159 rep)
Dec 26, 2022, 03:35 AM
Last activity: Jan 31, 2025, 10:14 PM