I am trying to get battery info in Termux.
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.