14

I know based on documentation that

Debugging information is stripped out. Debugging is disabled.

But can we somehow force to print logs, or maybe debug in release mode? "production app" I'm using Android Studio.

For example while developing android app in AS we are able to print logs

android:debuggable="true"
Jakub S.
  • 5,580
  • 2
  • 42
  • 37

2 Answers2

11

Plug your phone (if it is the case) on your computer and type on terminal:

$ flutter logs

You should be able to choose the device you want to see logs.

Cícero Moura
  • 2,027
  • 1
  • 24
  • 36
  • This does not show anything for me. `flutter logs Showing ELE L29 logs:` – Migalv Jan 11 '23 at 13:11
  • FWIW, looks like the behavior here is that it tails the logs, so you'd run this command, choose the device you want, then run your app on that device – Garrett Feb 14 '23 at 14:25
2

To display information that you would like to be visible in release mode ('production code') of your flutter app, simply use print() method. For info you want to hide in console log use debugPrint().

Maybe this part of documentation will help.

Paul Kastel
  • 913
  • 1
  • 13
  • 22