Find Related products on Amazon

Shop on Amazon

Dart added support for cross-compilation

Published on: 2025-07-16 12:15:26

dart compile This guide describes how to use the dart compile command to compile a Dart program to a target platform. Use the dart compile command to compile a Dart program to a target platform. The output—which you specify using a subcommand—can either include a Dart runtime or be a module (also known as a snapshot). lightbulb Tip To learn more information about this and other dart commands, check out the Dart command-line tool page. Here's an example of using the exe subcommand to produce a self-contained executable file ( myapp.exe ): dart compile exe bin/myapp.dart Generated: /Users/me/myapp/bin/myapp.exe The next example uses the aot-snapshot subcommand to produce an ahead-of-time (AOT) compiled module ( myapp.aot ). It then uses the dartaotruntime command (which provides a Dart runtime) to run the AOT module: dart compile aot-snapshot bin/myapp.dart Generated: /Users/me/myapp/bin/myapp.aot dartaotruntime bin/myapp.aot To specify the path to the output file, use the -o or - ... Read full article.