SIGN IN SIGN UP

[flutter_tools] Deprecate --build and --no-build flags on flutter run (#191358)

## Description

This PR formally deprecates the \`--build\` and \`--no-build\` flags on
\`flutter run\` in favor of \`--use-application-binary\`, aligning
\`flutter run\` with \`flutter drive\` (which previously deprecated
\`--build\`).

### Context & Changes
* In 2019 ([#37735](https://github.com/flutter/flutter/pull/37735)),
\`flutter run\` stopped handling the \`build\` flag when
\`--use-application-binary\` was added, but the flag definition was
unintentionally left on \`argParser\`, causing it to remain in
\`--help\` as a silent no-op.
* Rather than restoring implicit build-skipping behavior (which
introduces ambiguity regarding which derived artifact to run across
build flavors, split APKs, and schemes), we deprecate \`--[no-]build\`
and direct users to \`--use-application-binary\`.
* Hides \`--build\` from standard \`flutter run -h\` output (\`hide:
!verboseHelp\`).
* Emits a deprecation warning when \`--build\` or \`--no-build\` is
passed.
* Adds hermetic unit tests in \`run_test.dart\` for the deprecation
warnings.

## Related Issues
Fixes #68529

## Tests
- Added hermetic unit tests in
\`packages/flutter_tools/test/commands.shard/hermetic/run_test.dart\`
verifying warning triggers and default execution.
- Verified \`packages/flutter_tools/test/general.shard/args_test.dart\`
passes.
B
Ben Konyi committed
e210443e9ba4d249a4044de8eb18e79ba7784de6
Parent: 3512ebe
Committed by GitHub <noreply@github.com> on 8/21/2026, 4:45:08 PM