As the question reads, I want to log the current in milliAmpere or Ampere (both charging and discharging) over a period of time.
Please note I am not asking about charging or discharging rate, but rather on the current. I am aware of the app called Ampere which displays the current, which is good but I want them logged over a period of time. I am also aware of the app Battery Log, which logs the details but not the current.
Device info: Nexus 5 rooted, running stock 5.1.1. Ready to install custom kernel but stock ROM only.
Edit: Based on a comment from Firelord, I could see a file in
/sys/class/power_supply/battery/current_now which at the moment of writing had a number
835910 and after a second it became
673163. All these values were during the discharge phase.
When plugged in, it showed
412190 and the Ampere app showed
160mA. It seems this is the current, but I guess I have to average it out to compare it with Ampere's output.
Interestingly, there is another file named
status which has values
I also happen to know another question in this site.