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.

  • 1
    It's restricted by SELinux. Apps cannot access u:object_r:battery_service:s0 context. Dec 26, 2022 at 8:22
  • So this has no workaround?
    – sudoer
    Dec 26, 2022 at 9:33


You must log in to answer this question.

Browse other questions tagged .