質問

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!

役に立ちましたか?

解決

Try:

adb shell cat /proc/uptime

他のヒント

If you only need to-the-second accuracy, adb shell uptime will also work. Example output:

up time: 00:09:26, idle time: 00:07:15, sleep time: 00:00:00
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top