Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

docs.flutter.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.

Learn more

Flutter 3.41 is live! Check out theFlutter 3.41 blog post!

Flutter's build modes

Describes Flutter's build modes and when you should use debug, release, or profile mode.

The Flutter tooling supports three modes when compiling your app, and a headless mode for testing. You choose a compilation mode depending on where you are in the development cycle. Are you debugging your code? Do you need profiling information? Are you ready to deploy your app?

A quick summary for when to use which mode is as follows:

  • Usedebug mode during development, when you want to usehot reload.
  • Useprofile mode when you want to analyze performance.
  • Userelease mode when you are ready to release your app.

The rest of the page details these modes.

Debug

#

Indebug 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 asDevTools) can connect to the process.

Debug mode for a web app means that:

  • The build isnot minified and tree shaking hasnot been performed.
  • The app is compiled with thedartdevc compiler for easier debugging.

By default,flutter run compiles to debug mode. Your IDE supports this mode. Android Studio, for example, provides aRun > Debug... menu option, as well as a green bug icon overlaid with a small triangle on the project page.

Note

Release

#

Userelease 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 thedart2js compiler for best performance.

The commandflutter run --release compiles to release mode. Your IDE supports this mode. Android Studio, for example, provides aRun > Run... menu option, as well as a triangular green run button icon on the project page. You can compile to release mode for a specific target withflutter build <target>. For a list of supported targets, useflutter help build.

For more information, see the docs on releasingiOS andAndroid apps.

Profile

#

Inprofile mode, some debugging ability is maintained—enough to profile your app's performance. Profile mode is disabled on the emulator and simulator, because their behavior is not representative of real performance. On mobile, profile mode is similar to release mode, with the following differences:

  • Some service extensions, such as the one that enables the performance overlay, are enabled.
  • Tracing is enabled, and tools supporting source-level debugging (such asDevTools) can connect to the process.

Profile mode for a web app means that:

  • The build isnot minified but tree shaking has been performed.
  • The app is compiled with thedart2js compiler.
  • DevTools can't connect to a Flutter web app running in profile mode. Use Chrome DevTools togenerate timeline events for a web app.

Your IDE supports this mode. Android Studio, for example, provides aRun > Profile... menu option. The commandflutter run --profile compiles to profile mode.

Note

Use theDevTools suite to profile your app's performance.

For more information on the build modes, seeFlutter's build modes.

Was this page's content helpful?

Unless stated otherwise, the documentation on this site reflects Flutter 3.38.6. Page last updated on 2025-10-21.View source orreport an issue.


[8]ページ先頭

©2009-2026 Movatter.jp