Steev James
Steev James

Reputation: 2654

How to view Flutter debug console output for a release version of the app?

Using print() to log messages works in debug mode and I can see output in debug console of VSCode or in terminal. How can I get those with release build ? I have seen release build producing such logs but not sure how to get those.

Upvotes: 19

Views: 16899

Answers (2)

Zog
Zog

Reputation: 1143

The app needs to be in release mode on a plugged in device.

Steps

  1. Run the app on device in release mode flutter run --release
  2. Quit the app
  3. Open a terminal in the flutter project directory
  4. Run flutter logs

Note

  • Only print() statements will show
  • The device must be physically plugged in

Upvotes: 0

Steev James
Steev James

Reputation: 2654

Run

$ flutter logs

in terminal with terminal opened in a flutter project directory, connect phone with computer and use the release version of the app on phone to see logs similar to the debug version shows.

Edit: Not sure if this works for iOS.

Upvotes: 43

Related Questions