Android adb 取得電池 battery 電量資訊

本篇紀錄一下怎麼用 Android 查詢取得電池 battery 電量狀態,透過 adb 指令來取得電池電量資訊。

查詢 andoid 裝置電池 battery 剩餘電量資訊

1
$ adb shell dumpsys battery | grep level

參考
[1] android - Is it possible to query device state (ie. battery charge remaining) via ADB shell command? - Stack Overflow
https://stackoverflow.com/questions/42274720/is-it-possible-to-query-device-state-ie-battery-charge-remaining-via-adb-shel
[2] Android adb shell dumpsys battery 電池電量狀態 @ 不專業。工程師 :: 痞客邦 ::
http://blog.stepbystep.tw/blog/post/118831503