2

I am using Android Studio and wanted to see if I could get "prints" or logs from my app, which would help later in debugging of more involved apps.

My minSDK API is 9 and targetSDK API is 22.

So, I take the simplest HelloAndroid app, and add a Log.i with an appropriate tag in the oncreate method.

I install and run this app on my Samsung phone, which has the developer options set to enable USB debugging.

The app runs fine, and I can see the system logs.w or logs.i from the various managers, but I can't find the print message I had inserted.

I had already added debuggable = true in both manifest and gradle build script as well.

So, why can't I see my own log messages.

Thanks, Har Yash

4
  • some code would be necessary Aug 4, 2015 at 13:34
  • Stupid question... but... have you tried to filter the log output by your tag? Maybe there are so many lines that you're missing yours. And also, is your Samsung phone the only device connected, considering emulators too? If not, make sure you are viewing the logcat for your device.
    – lorenzo-s
    Aug 4, 2015 at 14:15
  • Hi, yeah, I did try to filter... but nothing... Aug 4, 2015 at 16:15
  • Hi, the only device connected is the samsung phone (android 4.4.4) and I was viewing msgs for my app only in logcat window in the main studio UI... so I see system messages related to the app only... there are not too many... hence I was expecting to see msg which I had put... now, I set the filter on tag, inside the Android Device Monitor, and then I see my logs... one interesting point is that I can see the logs disappearing and re-appearing as the activity goes out and in the foreground... so thanks!!! Aug 4, 2015 at 16:35

1 Answer 1

0

In my case, I needed to reinstall the application on my device to see at least the logs. It seems that android studio was not running the actual version of my code...

Maybe these links could help to solve the problem in that case:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.