2
\$\begingroup\$

I am working on a monogame android project where I want to log some data. First try was something like this:

Log.Info(tag, message);

This works great when debugging in Visual Studio via the Android Device Logging-Window. But when I run the app on my mobile android device I have no idea how to view the log entries. As far as I know the logging happens in the so called CatLog, which can be viewed with some Apps. But unfortunately these apps need root access, which I think cannot be given to them on a "normal" android device.

Is there any way to either view the Logfile on my Android device or is there a better way of adding logging to my project?

Thanks in advance Nick

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I'm not familiar with monogame but LogCat can be viewed not only by using apps but also from command line tool adb(android debug bridge).

Assuming that you had to install android sdk You should be able to do this steps in your command line/shell:

  1. Change dir to /YOUR_SDK_PATH/platform-tools eg. cd ~/android-sdk/platform-tools
  2. Run adb with logcat option adb logcat for windows adb.exe logcat

The problematic outcome is that it prints whole LogCat output so you may want to filter it for your needs.

For more information about filtering check this SO thread.

Info: You may need to enable option 'USB Debugging' in 'Developers Options' on your device.

If command line related solutions aren't for you try to install Android Studio. It has 'Android Monitor' panel that does the most work and allows you to define own filters using GUI.

Extra: After some googling I've found tool called mLogcat which maybe be useful for You as alternative to Android Studio.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .