Skip to content

Running flutter apps

Hidenori Matsubayashi edited this page Aug 30, 2023 · 14 revisions

If you use the run sub-command, the build sub-command will be also done automatically. We prepare two devices for Linux desktops, which are elinux-wayland and elinux-x11.

Use Wayland Flutter runner

Note: you need to install a Wayland compositor such as Weston and launch it before launching your Flutter apps.

Debug mode

You can Dart debugger and profiler in this mode.

flutter-elinux run -d elinux-wayland

Profile mode

You can Dart profiler in this mode.

flutter-elinux run -d elinux-wayland --profile

Release mode

flutter-elinux run -d elinux-wayland --release

Pass custom run options of the embedder

You can use FLUTTER_ELINUX_CUSTOM_RUN_ARGS env if you want to run a flutter app with your specific options such as screen-size (--width). See also https://github.com/sony/flutter-embedded-linux/wiki/How-to-run-Flutter-apps#command-options for the options of the embedder.

FLUTTER_ELINUX_CUSTOM_RUN_ARGS="--width=640 --height=480" flutter-elinux run -d elinux-wayland

Use X11 Flutter runner

flutter-elinux run -d elinux-x11

Use custom-devices

You can install, uninstall, debug, and so on to remote arm64 devices such as Raspberry Pi4 from host desktops. See Remote target devices

Run without the flutter-elinux command

The executable binary can be found in your project under ./build/<target_arch>/<build_mode>/bundle. See Command options for the details.

# Checks command options
./build/<target_arch>/<build_mode>/bundle/<your_app_name> --help

# Run your flutter app
./build/<target_arch>/<build_mode>/bundle/<your_app_name>

See also: