Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Latest Questions
3
votes
1
answers
2333
views
dumpsys battery in Termux
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 e...
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.
sudoer
(159 rep)
Dec 26, 2022, 03:35 AM
• Last activity: Jan 31, 2025, 10:14 PM
1
votes
0
answers
95
views
Dumpsys output documentation? Hex number after package name, e.g. Package [com.android.fmradio] (2af5b15)
Running adb shell dumpsys | sed -n '/^Packages:/,/^[[:space:]]*$/p' yields a lot of information about installed packages. For example: Packages: Package [com.android.fmradio] (2af5b15): ... Following each package name `com.android.fmradio` there is a hex number, here `2af5b15`, in brackets - what do...
Running
adb shell dumpsys | sed -n '/^Packages:/,/^[[:space:]]*$/p'
yields a lot of information about installed packages. For example:
Packages:
Package [com.android.fmradio] (2af5b15):
...
Following each package name
com.android.fmradio
there is a hex number, here 2af5b15
, in brackets - what does this mean? Where do I find comprehensive documentation about dumpsys
output? So far, I couldn't find anything on https://developer.android.com/tools/dumpsys about this, unfortunately.
Ruben P. Grady
(21 rep)
Jan 20, 2025, 05:42 PM
• Last activity: Jan 20, 2025, 05:52 PM
2
votes
1
answers
251
views
What is meant by "proportional" and "smearing" in batterystats
I want to analyze battery consumption of an app and ran: ``` > adb shell dumpsys batterystats > dump.txt ``` Within the filedump I found the section I am interested in: ``` Estimated power use (mAh): Capacity: 3020, Typical: 3100, Computed drain: 1395, actual drain: 1510-1570 Screen: 770 Excluded fr...
I want to analyze battery consumption of an app and ran:
> adb shell dumpsys batterystats > dump.txt
Within the filedump I found the section I am interested in:
Estimated power use (mAh):
Capacity: 3020, Typical: 3100, Computed drain: 1395, actual drain: 1510-1570
Screen: 770 Excluded from smearing
Uid u0a387: 364 ( wake=5.23 radio=0.0425 wifi=4.51 gps=349 sensor=4.88 ) Including smearing: 402 ( proportional=38.6 )
Cell standby: 128 ( radio=128 ) Excluded from smearing
Unaccounted: 115 ( ) Including smearing: 0 ( ) Excluded from smearing
Uid u0a382: 40.6 ( wake=5.00 radio=1.40 wifi=34.2 ) Including smearing: 801 ( screen=684 proportional=76.9 )
Idle: 27.4 Excluded from smearing
Uid u0a83: 17.7 ( wake=0.240 radio=0.202 wifi=5.84 gps=2.33 sensor=9.06 ) Including smearing: 19.6 ( proportional=1.88 )
Wifi: 10.0 ( wifi=10.0 ) Including smearing: 11.1 ( proportional=1.07 )
...
Each line contains info on "smearing", and if smearing is included part of this seems to be something called "proportional". These terms are not explained at all in the documentation.
M.T
(131 rep)
Apr 20, 2022, 11:29 AM
• Last activity: Apr 21, 2022, 07:01 AM
2
votes
0
answers
326
views
dumptrace file - /data/anr/
On Android Pie, everytime we take a bugreport, it generates a temporary file in data/anr. This temporary file is not cleared and stays on the device. Its size is around 2MB. This means everytime I take a bugreport on my device, the data/anr folder will have dumpstate_XXXX file that is taking up some...
On Android Pie, everytime we take a bugreport, it generates a temporary file in data/anr. This temporary file is not cleared and stays on the device. Its size is around 2MB. This means everytime I take a bugreport on my device, the data/anr folder will have dumpstate_XXXX file that is taking up some space. How does Android clean this file and how often does it clean this file if at all? Else won't it cause my device to run out of memory eventually?
Raju
(21 rep)
Feb 25, 2021, 08:10 PM
2
votes
0
answers
1377
views
/bin/sh: dumpsys: not found
I am working on an 845 uSOM (Linux sda845 4.9.103) and want to modify USB charging/battery behavior. I'm not the most knowledgeable when it comes to working with adb, and I am not sure how to move forward. It seems that I can neither use 'dumpsys' or 'service call'. My ultimate goal is for things li...
I am working on an 845 uSOM (Linux sda845 4.9.103) and want to modify USB charging/battery behavior. I'm not the most knowledgeable when it comes to working with adb, and I am not sure how to move forward. It seems that I can neither use 'dumpsys' or 'service call'. My ultimate goal is for things like:
adb shell dumpsys battery unplug
adb shell dumpsys battery set
I am told online that in order to find the name of the service I need in place of 'battery' I need to use:
adb shell service list
However, this isn't found either. Am I supposed to use systemctl at this point?
systemctl list-unit-files
yields a service called 'charger_monitor.service' but at this point I don't know if I've found something useful or I am completely off the scent. Do I need to get dumpsys on this system? I thought that if I could use adb on a device then dumpsys came along with it but maybe it is not applicable on this uSOM?
Troy
(21 rep)
Dec 21, 2020, 06:35 PM
1
votes
2
answers
6524
views
ADB dumpsys batterystats - How does one read it?
Why on earth does the `adb shell dumpsys batterystats` command not print regular timestamps? (Like `usagestats` does for example, or literally anything else on the planet.) Instead, it gives you a "RESET TIME" within the file, and the lines after that show how much time has passed since that time. "...
Why on earth does the
adb shell dumpsys batterystats
command not print regular timestamps? (Like usagestats
does for example, or literally anything else on the planet.)
Instead, it gives you a "RESET TIME" within the file, and the lines after that show how much time has passed since that time. "RESET" times mostly appear just once at the beginning, sometimes however they appear multiple times within the log, sometimes even skipping hours, seemingly at random.
And as if that isn't bad enough.. Let me just show a real-life example:
adb shell dumpsys batterystats
Gives me (among other things of course) this:
0 (9) RESET:TIME: 2020-01-29-01-37-39
Good. So the time starts at 2020-01-29-01-37-39
. Alright. Only reset time in the output.
I just turned the screen on. Here is the entry in the log for that:
+21h44m19s484ms (4) 057 +wake_lock=1000:"PhoneWindowManager.mPowerKeyWakeLock" +screen screenwake=1000:"android.policy:POWER"
Great. +21h44m19s
. It is now (well, it was when this happened) 2020-01-30-00-16-00
.
"RESET" time of 2020-01-29-01-37-39
+ 21h44m19s
= 2020-01-29-23-21-58
. **?????**
----------
Okay, down to my actual questions:
1. Why does dumpsys batterystats
not use normal timestamps?
2. How does one read those timestamps? They seem beyond broken.
3. Is there a way to change it to "normal" timestamps?
----------
(My goal is to track when exactly the screen (and optionally WiFi) was on and when it was off. If there is any other way to do that besides batterystats
, please leave a comment.)
confetti
(622 rep)
Jan 30, 2020, 02:54 AM
• Last activity: Oct 23, 2020, 09:17 PM
1
votes
1
answers
1459
views
Coordinates from 'dumpsys location' are censored on Huawei devices
I'd like to read coordinates from my Huawei P30 Pro via ADB by calling `adb shell dumpsys location`. However, the output is like: Last Known Locations: gps: Location[gps 11******,14****** ... They are censored with stars even though the GPS is already turned on. Any idea?
I'd like to read coordinates from my Huawei P30 Pro via ADB by calling
adb shell dumpsys location
. However, the output is like:
Last Known Locations:
gps: Location[gps 11******,14****** ...
They are censored with stars even though the GPS is already turned on.
Any idea?
mahack
(11 rep)
Apr 16, 2020, 02:03 PM
• Last activity: Apr 18, 2020, 09:59 AM
1
votes
1
answers
766
views
What are the Wi-Fi disconnect reasons on adb dumpsys wifi?
`adb dumpsys wifi` gives me, among many others, lines like this: Event [IFNAME=wlan0 CTRL-EVENT-DISCONNECTED bssid=X reason=7] What does `reason=7` mean? What other reasons are there? If [this](https://www.toomanyatoms.com/computer/disconnection_codes.html) applies to Android aswell (I guess so sinc...
adb dumpsys wifi
gives me, among many others, lines like this:
Event [IFNAME=wlan0 CTRL-EVENT-DISCONNECTED bssid=X reason=7]
What does reason=7
mean? What other reasons are there?
If [this](https://www.toomanyatoms.com/computer/disconnection_codes.html) applies to Android aswell (I guess so since Android does use wpa_supplicant), reason 7 would translate to "Class 3 frame received from nonassociated STA"
- Now what does that mean?
(I'm trying to debug WiFi disconnects that shouldn't happen.)
confetti
(622 rep)
Jan 17, 2020, 07:11 PM
• Last activity: Jan 18, 2020, 11:53 AM
Showing page 1 of 8 total questions