Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Time displayed in Logcat

I need to get the Android device timestamp in the format hh:mm:ss:SS. I am able to view the time displayed in the Logcat of Eclipse. Is it the computer's time or is it the Android device's time?

like image 376
user1741274 Avatar asked Feb 27 '13 14:02

user1741274


People also ask

How do I read Logcat logs?

View your app logs To display the log messages for an app: Build and run your app on a device. Click View > Tool Windows > Logcat (or click Logcat in the tool window bar).

What is verbose Logcat?

Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.

Why is my Logcat not showing anything in Android?

Solution 1: Restarting your Android StudioIn your IDE Go to File > Invalidate Caches and Restart > Invalidate and Restart. This Solution will clear all the caches of Android studio IDE and restart it automatically, By the method, there are 80% change that Logcat will start work as before.


2 Answers

From the docs of logcat you can see that there is an option to specify how the output is formatted (-v).

To get a timestamp, you can use the command

logcat -v time 

This will prefix each message with a timestamp.

like image 85
brianestey Avatar answered Oct 11 '22 06:10

brianestey


use adb logcat -v threadtime in terminal to take the logs from device, it will include date and time.

if you want to redirect these logs into a text file then use command in terminal.

 adb logcat -v threadtime > folder_path_in_the_computer/filename.txt 
like image 21
AAnkit Avatar answered Oct 11 '22 04:10

AAnkit