Home > Blockchain >  Flutter build web vs Flutter build web --release
Flutter build web vs Flutter build web --release

Time:12-23

Can someone explain me what's the difference if I put --release or if I don't? Which mode does it choose if don't write the --release argument?

Thanks in advance

CodePudding user response:

In debug mode, the app is set up for debugging on the physical device, emulator, or simulator.

Debug mode for mobile apps mean that:

  • Assertions are enabled.
  • Service extensions are enabled.
  • Compilation is optimized for fast development and run cycles (but not for execution speed, binary size, or deployment).
  • Debugging is enabled, and tools supporting source level debugging (such as DevTools) can connect to the process.

Debug mode for a web app means that:

  • The build is not minified and tree shaking has not been performed.
  • The app is compiled with the dartdevc compiler for easier debugging.

Use release mode for deploying the app, when you want maximum optimization and minimal footprint size. For mobile, release mode (which is not supported on the simulator or emulator), means that:

  • Assertions are disabled.
  • Debugging information is stripped out.
  • Debugging is disabled.
  • Compilation is optimized for fast startup, fast execution, and small package sizes.
  • Service extensions are disabled.

Release mode for a web app means that:

  • The build is minified and tree shaking has been performed.
  • The app is compiled with the dart2js compiler for best performance.

more infor Flutter's build modes

CodePudding user response:

I think this question has the answer you need, it runs but without debug features.

Flutter debug vs release builds

  • Related