I'm writing a script containing several "adb shell" command. I also want to record the time when program execute these command in a form of realtime and uptime. I know I can get uptime and realtime through SystemClock:
SystemClock.uptimeMillis();
SystemClock.elapsedRealtime();
Is there any way I can get these information from the command line?
Thanks a lot!
dumpsys is a tool that runs on Android devices and provides information about system services. You can call dumpsys from the command line using the Android Debug Bridge (ADB) to get diagnostic output for all system services running on a connected device.
dumpsys gfxinfo is a shell command you can use on the device via the command line. It provides you a dump of the rendering information of your current application instance and included in that dump is your app's Jank info.
To use adb with a device connected over USB, you must enable USB debugging in the device system settings, under Developer options. To use adb with a device connected over Wi-Fi, see Connect to a device over Wi-Fi. On Android 4.2 and higher, the Developer options screen is hidden by default.
Try:
adb shell cat /proc/uptime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With