19

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.

2 Answers 2

42

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.

Sign up to request clarification or add additional context in comments.

8 Comments

Please Elaborate what are you trying to say here? A released version of the app is not connected to any console. So, where to write that command. Or first connect the mobile device to a system and run flutter logs in the console?
@TahaMalik, Run this command in terminal, connect phone & run the release version of the app & it shows logs like in debug mode.
This does not seem to work on IOS
i confirm that it does not work on ios
not working in ios
|
0

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

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.