How to get the health of the Android system in real time from the command line?

I am writing a script containing several adb shell commands. I also want to record the time when the program executes this command in the form of real time and uptime. I know that I can get uptime in real time through SystemClock:

SystemClock.uptimeMillis(); SystemClock.elapsedRealtime(); 

Is there any way to get this information from the command line?

Thanks a lot!

+4
source share
2 answers

Try:

 adb shell cat /proc/uptime 
+9
source

If you only need precision, adb shell uptime will also work. Output Example:

 up time: 00:09:26, idle time: 00:07:15, sleep time: 00:00:00 
+3
source

Source: https://habr.com/ru/post/1496043/


All Articles