Skip to content

Commit 398d5f7

Browse files
committed
Add release mode option to debug command
Introduces a --release flag to the debug command, allowing users to build the app in release mode. Also updates argument handling to support the new option.
1 parent fd0ebbe commit 398d5f7

File tree

1 file changed

+17
-0
lines changed
  • sdk/python/packages/flet-cli/src/flet_cli/commands

1 file changed

+17
-0
lines changed

sdk/python/packages/flet-cli/src/flet_cli/commands/debug.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None:
5050
default=False,
5151
help="Show connected devices for iOS and Android builds.",
5252
)
53+
parser.add_argument(
54+
"--release",
55+
dest="release",
56+
action="store_true",
57+
default=False,
58+
help="Build the app in release mode.",
59+
)
5360
parser.add_argument(
5461
"--route",
5562
type=str,
@@ -119,6 +126,16 @@ def add_flutter_command_args(self, args: list[str]):
119126
assert self.device_id
120127
args.extend(["run", "-d", self.device_id])
121128

129+
if self.options:
130+
if self.options.release:
131+
args.append("--release")
132+
if self.options.route and self.debug_platform in [
133+
"web",
134+
"ios",
135+
"android",
136+
]:
137+
args.extend(["--route", self.options.route])
138+
122139
def run_flutter(self):
123140
assert self.platforms
124141
assert self.target_platform

0 commit comments

Comments
 (0)