Monday, January 14, 2008

Viewing Android Debugging Log


When our application is installed on android emulator, we run it and expect it will running successfully. But, sometimes it is unsuccessfully, an error message appears, sometimes, likely it is not from our application, so how to know which part of our codes is currently throwing the error..

An alternative way is to watch the log produced by the emulator. Just run the emulator, wait until completed, then from shell, issue command:

adb logcat

The log will be show up at a new windows, and you can watch which part of your codes currently throwing error.











ok, have a nice try!

6 comments:

Willem Vermeer said...

great tip, thanks!

perumal said...

Is it possible to show the log to user by using an android app? So that user can view it in the phone itself. One way is to 'dmesg' in the terminal emulator but is there any other way?

Zied said...

Is there a way to display the log in the Eclipse's console? (Since I use Eclipse to start the emulator). thx

Unknown said...

You can view the log in Eclipse if you switch to the DDMS perspective and there will be a "logcat" view in the bottom section.

Rahul said...

What is in Netbeans for DDMS

-DC- said...

NetBeans isn't supported, but you can run it from the /tools directory.