最終更新:2022-01-17 (月) 22:41:54 (126d)  

flutter run
Top / flutter run

デバイス指定

  • d, --device-id : Target device id or name (prefixes allowed).
  • flutter run -d <device id>
  • flutter run -d chrome
  • flutter run -d all

デバイスID

--no-sound-null-safety

ビルドモード

help

  • Run your Flutter app on an attached device.
    
    Global options:
    -h, --help                  Print this usage information.
    -v, --verbose               Noisy logging, including all shell commands executed.
                                If used with "--help", shows hidden options. If used with "flutter doctor", shows additional diagnostic information. (Use "-vv" to
                                force verbose logging in those cases.)
    -d, --device-id             Target device id or name (prefixes allowed).
        --version               Reports the version of this tool.
        --suppress-analytics    Suppress analytics reporting when this command runs.
    
    Usage: flutter run [arguments]
    -h, --help                                        Print this usage information.
        --debug                                       Build a debug version of your app (default mode).
        --profile                                     Build a version of your app specialized for performance profiling.
        --release                                     Build a release version of your app.
        --dart-define=<foo=bar>                       Additional key-value pairs that will be available as constants from the String.fromEnvironment,
                                                      bool.fromEnvironment, int.fromEnvironment, and double.fromEnvironment constructors.
                                                      Multiple defines can be passed by repeating "--dart-define" multiple times.
        --flavor                                      Build a custom app flavor as defined by platform-specific build setup.
                                                      Supports the use of product flavors in Android Gradle scripts, and the use of custom Xcode schemes.
        --web-renderer                                The renderer implementation to use when building for the web.
    
              [auto] (default)                        Use the HTML renderer on mobile devices, and CanvasKit on desktop devices.
              [canvaskit]                             Always use the CanvasKit renderer. This renderer uses WebGL and WebAssembly to render graphics.
              [html]                                  Always use the HTML renderer. This renderer uses a combination of HTML, CSS, SVG, 2D Canvas, and WebGL.
    
        --trace-startup                               Trace application startup, then exit, saving the trace to a file. By default, this will be saved in the
                                                      "build" directory. If the FLUTTER_TEST_OUTPUTS_DIR environment variable is set, the file will be written
                                                      there instead.
        --verbose-system-logs                         Include verbose logging from the Flutter engine.
        --cache-sksl                                  Cache the shader in the SkSL format instead of in binary or GLSL formats.
        --dump-skp-on-shader-compilation              Automatically dump the skp that triggers new shader compilations. This is useful for writing custom
                                                      ShaderWarmUp to reduce jank. By default, this is not enabled as it introduces significant overhead. This is
                                                      only available in profile or debug builds.
        --purge-persistent-cache                      Removes all existing persistent caches. This allows reproducing shader compilation jank that normally only
                                                      happens the first time an app is run, or for reliable testing of compilation jank fixes (e.g. shader
                                                      warm-up).
        --route                                       Which route to load when running the app.
        --use-application-binary=<path/to/app.apk>    Specify a pre-built application binary to use when running. For Android applications, this must be the path
                                                      to an APK. For iOS applications, the path to an IPA. Other device types do not yet support prebuilt
                                                      application binaries.
        --[no-]start-paused                           Start in a paused mode and wait for a debugger to connect.
        --endless-trace-buffer                        Enable tracing to an infinite buffer, instead of a ring buffer. This is useful when recording large traces.
                                                      To use an endless buffer to record startup traces, combine this with "--trace-startup".
        --trace-systrace                              Enable tracing to the system tracer. This is only useful on platforms where such a tracer is available
                                                      (Android and Fuchsia).
        --trace-skia                                  Enable tracing of Skia code. This is useful when debugging the raster thread (formerly known as the GPU
                                                      thread). By default, Flutter will not log Skia code, as it introduces significant overhead that may affect
                                                      recorded performance metrics in a misleading way.
    -a, --dart-entrypoint-args                        Pass a list of arguments to the Dart entrypoint at application startup. By default this is main(List<String>
                                                      args). Specify this option multiple times each with one argument to pass multiple arguments to the Dart
                                                      entrypoint. Currently this is only supported on desktop platforms.
    -t, --target=<path>                               The main entry-point file of the application, as run on the device.
                                                      If the "--target" option is omitted, but a file name is provided on the command line, then that is used
                                                      instead.
                                                      (defaults to "lib\main.dart")
        --device-vmservice-port                       Look for vmservice connections only from the specified port.
                                                      Specifying port 0 (the default) will accept the first vmservice discovered.
        --host-vmservice-port                         When a device-side vmservice port is forwarded to a host-side port, use this value as the host port.
                                                      Specifying port 0 (the default) will find a random free host port.
        --[no-]pub                                    Whether to run "flutter pub get" before executing this command.
                                                      (defaults to on)
        --[no-]track-widget-creation                  Track widget creation locations. This enables features such as the widget inspector. This parameter is only
                                                      functional in debug mode (i.e. when compiling JIT, not AOT).
                                                      (defaults to on)
        --[no-]null-assertions                        Perform additional null assertions on the boundaries of migrated and un-migrated code. This setting is not
                                                      currently supported on desktop devices.
        --device-user=<10>                            Identifier number for a user or work profile on Android only. Run "adb shell pm list users" for available
                                                      identifiers.
        --device-timeout=<10>                         Time in seconds to wait for devices to attach. Longer timeouts may be necessary for networked devices.
        --dds-port                                    When this value is provided, the Dart Development Service (DDS) will be bound to the provided port.
                                                      Specifying port 0 (the default) will find a random free port.
    -P, --android-project-arg                         Additional arguments specified as key=value that are passed directly to the gradle project via the -P flag.
                                                      These can be accessed in build.gradle via the "project.property" API.
        --[no-]multidex                               When enabled, indicates that the app should be built with multidex support. This flag adds the dependencies
                                                      for multidex when the minimum android sdk is 20 or below. For android sdk versions 21 and above, multidex
                                                      support is native.
                                                      (defaults to on)
        --enable-software-rendering                   Enable rendering using the Skia software backend. This is useful when testing Flutter on emulators. By
                                                      default, Flutter will attempt to either use OpenGL or Vulkan and fall back to software when neither is
                                                      available.
        --skia-deterministic-rendering                When combined with "--enable-software-rendering", this should provide completely deterministic (i.e.
                                                      reproducible) Skia rendering. This is useful for testing purposes (e.g. when comparing screenshots).
        --[no-]await-first-frame-when-tracing         Whether to wait for the first frame when tracing startup ("--trace-startup"), or just dump the trace as soon
                                                      as the application is running. The first frame is detected by looking for a Timeline event with the name
                                                      "Rasterized first useful frame". By default, the widgets library's binding takes care of sending this event.
                                                      (defaults to on)
        --[no-]use-test-fonts                         Enable (and default to) the "Ahem" font. This is a special font used in tests to remove any dependencies on
                                                      the font metrics. It is enabled when you use "flutter test". Set this flag when running a test using "flutter
                                                      run" for debugging purposes. This flag is only available when running in debug mode.
        --[no-]build                                  If necessary, build the app before running.
                                                      (defaults to on)
        --[no-]hot                                    Run with support for hot reloading. Only available for debug mode. Not available with "--trace-startup".
                                                      (defaults to on)
        --pid-file                                    Specify a file to write the process ID to. You can send SIGUSR1 to trigger a hot reload and SIGUSR2 to
                                                      trigger a hot restart. The file is created when the signal handlers are hooked and deleted when they are
                                                      removed.
    
    Run "flutter help" to see global options.