Flutter Builder

July 18, 2026 · View on GitHub

English | 简体中文

Flutter Builder invokes the Flutter CLI from the project environment, builds for a platform, locates raw artifacts, and returns a normalized build result. The top-level fastforge build command currently uses this builder directly.

Project Requirements

  • Run from the root of a project containing pubspec.yaml
  • Install the Flutter SDK and make flutter available in PATH
  • Prepare the target platform SDK, signing configuration, and build tools

The builder reads version from pubspec.yaml and passes the version name and build number through FLUTTER_BUILD_NAME and FLUTTER_BUILD_NUMBER respectively.

Platforms and Targets

PlatformTargetOutput
androidapkAPK
androidaabAAB
iosipa or omittedIPA
macosMay be omitted.app
windowsMay be omittedWindows bundle
linuxMay be omittedLinux bundle
webMay be omittedWeb directory
ohoshap, appHAP or APP

Common Commands

fastforge build --platform android --target apk
fastforge build --platform web
fastforge build --platform macos

An iOS IPA requires export configuration:

fastforge build --platform ios --target ipa \
  --build-export-options-plist ios/ExportOptions.plist

You can also use --build-export-method.

Build Options

Fastforge optionEffect
--cleanClean before building
--build-targetUse a custom entry point
--build-flavorSelect a flavor
--build-target-platformSelect target architectures
--build-export-options-plistProvide iOS export configuration
--build-export-methodSelect an iOS export method
--build-dart-define KEY=VALUECompile-time variable; repeatable
--build-obfuscateEnable obfuscation
--build-split-debug-infoSet the debug-symbol output directory
--build-tree-shake-iconsEnable icon tree shaking
--build-profileUse Profile mode
--flutter-build-argsOther build arguments, comma-separated

Within --flutter-build-args, entries without an equals sign are treated as boolean switches, while key=value entries become key-value arguments. Do not use this option when a value itself contains a comma.

Artifact Locations

PlatformDefault search location
Android APKbuild/app/outputs/flutter-apk/
Android AABbuild/app/outputs/bundle/
iOSbuild/ios/ipa/
macOSbuild/macos/Build/Products/
Windowsbuild/windows/<arch>/runner/<mode>/
Linuxbuild/linux/<arch>/<mode>/bundle/
Webbuild/web/
OpenHarmony HAPohos/entry/build/<flavor>/outputs/<flavor>/
OpenHarmony APPohos/build/outputs/<flavor>/

Fastforge reports a failure if the build command succeeds but no artifact is found in the expected directory.

Relationship to Packagers

Flutter Builder can build all platforms listed above, but fastforge package currently connects only its macOS DMG, PKG, and ZIP paths. When a Flutter project runs fastforge package for another platform, the build completes normally and then fails with Unsupported package target because the matching packager is not connected. Use fastforge build to generate the raw artifact first.

Host Restrictions

  • iOS and macOS builds run only on macOS.
  • Windows builds run only on Windows.
  • Linux builds run only on Linux.
  • Android, Web, and OpenHarmony builders do not enforce a fixed host, but still require the relevant platform toolchains.