dart (Dart VM)
Here’s an example of running a Dart file on the command line:
$ dart --enable-asserts test.dart
Common command-line options for dart include:
assertstatements. When asserts are enabled, an assert statement checks a boolean condition, raising an exception if the condition is false.
Specifies the path to the package resolution configuration file. For more information, see Package Resolution Configuration File. This option cannot be used with
Specifies where to find imported libraries. This option cannot be used with
Sets the upper limit of old space to
- Displays VM version information.
Displays help. (Add
-vfor information about all options.)
Observatory is a tool for profiling and debugging your apps. You can use the following flags to enable Observatory and to instruct the VM to delay the start up, or the exit, of an isolate:
- Enables Observatory on localhost port 8181.
- Enables Observatory on localhost for the specific port.
Enables Observatory on an external network using the specified IP address and port. For example:
- Causes the VM to pause each isolate that would otherwise exit. If your standalone app executes quickly, it might exit before you can open Observatory. To avoid this situation, specify this flag on startup. You must explicitly release all isolates in the Observatory debugger.
- Causes the VM to pause before starting any isolate. You must explicitly start each isolate in the Observatory debugger.
A shortcut that combines
- On Windows, Observatory’s CPU Profiler screen is disabled by default. Use this option to enable it.
The following is an example Observatory run:
$ dart --observe <script>.dart
For more information, see Observatory.
You can also generate snapshots:
Generates a snapshot in the specified file. For information on generating and running snapshots, see Snapshots on GitHub.