Flutter debugging release mode, enable logs in release mode

2,728

Solution 1

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.

Solution 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.

Share:
2,728
Jakub S.
Author by

Jakub S.

Work hard until your idols become your rivals.

Updated on December 25, 2022

Comments

  • Jakub S.
    Jakub S. over 1 year

    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.
    Jakub S. about 3 years
    this is not the solution for logs in production ver.
  • IulianT
    IulianT over 2 years
    using pring or debugprint in release (flutter run --release) on ios does not log anything