Search This Blog

Saturday, August 27, 2011

How to add LogCat ?

Logcat is the command to view the internal logs of the Android system. Viewing logs is often the best way to diagnose a problem, and is required for many issues. This way you'll find out what apps are doing in the background without you noticing.

Advantages of Logcat

  • Debugging
  • You can see what processes are running, if a process is running after a certain interval of time, it will eat battery. So you can also find out what is draining your battery.

In Eclipse, Goto Window-> Show View -> Other -> Android-> Logcat.


How do I install it?
  1. Make sure you've enabled on USB debugging on your phone in Settings -> Application -> Development
  2. 2. Get the Android SDK here: Android SDK | Android Developers
  3. Extract the SDK to any folder say C:\Android
  4. Make sure that you have installed the drivers for your phone and the operating system recognizes your phone.
Everything installed? Continuing...
Now how to actually access the log, everything in italic are commands you need to enter.

  1. Open the 'run' dialog by pressing the 'Windows' + 'r' buttons on your keyboard (minimize the browser & other non-windows programs)
  2. cmd (this will open a DOS prompt)
  3. cd c:\Android\tools (go to the directory where you extracted the SDK)
  4. adb shell
  5. Now you'll see just a '$'
  6. logcat

You can now just press the power button on your phone to see what happens. It displays everything the device is doing.

So the thing is: leave your device connected for a while and see what is actually going on when you're not using it.

No comments:

Post a Comment