Save LogCat to a Text File

How to Save LogCat to a Text File

1. Determine ADB location. The ADB is already running by default. To catch and save the logs from LogCat you must first determine where your adb.exe is located on your computer. My location is similar to this: C:\Documents and Settings\...\Local Settings\Application Data\Android\android-sdk\platform-tools

2. Open terminal window. Click Start - Run. Type cmd then click Ok button.

3. Navigate to the ADB directory. At the c:\ prompt type cd and the location of your ADB directory
 
   cd C:\Documents and Settings\...\Local Settings\Application Data\Android\android-sdk\platform-tools

4. Clear LogCat. Before logging and saving your LogCat text file, you should clear the contents of LogCat. The file can get very big otherwise. Type the below at the c:\ prompt.

     adb logcat -c

5. Test your app. Now is the time to do your Android app testing that you want saved in LogCat. (Example: Install your app, open your app, test app, get error, close app)

6. Save LogCat. To save the LogCat file type the below at the c:\ prompt.

       adb logcat -d > c:\mydirectory\mylogcat.txt

7. Open LogCat text file. Open the text file using your favorite text editor.