title: Android How to measure app power consumption when plugged
body: <p>How to measure app power consumption when I connect my device with my pc?</p>
  
  <p>I've read about <a href="https://developer.android.com/studio/profile/battery-historian.html" rel="nofollow">batterystats</a> from Android Studio. And I've followed the instructions and get a batterystats dumpsys. However, I can't not let my device consistently plugged on usb port because the result of dumpsys will have a missing part called "Estimated power use". Which is the most important part of the whole test because the app power consumption it contained. </p>
  
  <p>I've tried using <a href="https://play.google.com/store/apps/details?id=es.guille.stopcharge&amp;hl=zh_TW" rel="nofollow">StopCharge</a> app to interrupt phone charging. But the prerequisite is that the device need to get ROOT.</p>
  
  <p>Other options like power tutor is outdated. Information out from the application can't quite fit my request(Android 6.0 or upper).</p>
  
  <p>Is it possible to get the power consumption measurement of an application when it's charging or is my mind out of the roof?</p>
  
  <p>Thank you in advance! </p>
  
  <p>p.s the following is a sample of the method of Android Studio batterystats</p>
  
  <pre><code>Estimated power use (mAh)
  Capacity: 2930, Computed drain: 43.9, actual drain: 58.6-87.9
  Screen: 35.6
  Unaccounted: 14.7 ( )
  Uid u0a2618: 2.91 ( cpu=2.17 wake=0.657 wifi=0.00656 sensor=0.0732 )
  </code></pre>