If you’re currently developing any android apps, you might be wondering how to check debug messages when running the apps on a physical device. Android SDK actually comes with an utility called Logcat, which does exactly that.
If you’re running Eclipse IDE and it is not showing any debug messages, your Eclipse is probably not linked to the Logcat. You can set it up by going to:
Window -> Show View -> Other… -> Android -> LogCat
However, if you’re running other development tools that don’t support this feature (such as Unity Engine), you can fire up Logcat manually by using the command pad/terminal.
On Windows, you need to enter the (android sdk folder)\platform-tools folder before calling Logcat:
After that, you can call Logcat by first calling the ADB (Android Debug Bridge) and launch Logcat from it, like so:
However, if you’re just calling adb logcat you may see the terminal going crazy by showing tons of debug texts in crazy speed. This is because the Logcat is actually displaying debug texts of ALL the processes running on your device. You definitely do not want that, don’t you?
You can add an extra parameter behind the command which filters out the process list and only display your app. For example, if your app is built using Unity Engine, you can call:
adb logcat -s Unity
…which looks like this on the terminal:
That’s all. You can now easily debug your app and know exactly what’s going when bugs occur. Happy debugging!