dart2native 使用Dart 在macOS,Windows或Linux上创建命令行工具

>dart2native --help

编写源文件

// bin\main.dart
main(List<String> args) {
  print('hello world');
}

打包

>dart2native ./bin\main.dart -o ./hello

λ ./hello
hello world

也可以打包为exe文件

>dart2native .\bin\main.dart -o ./hello.exe
Generated: d:\ajanuw\dart-test\hello.exe

>hello.exe
hello world
posted @ 2019-11-06 08:13  Ajanuw  阅读(1140)  评论(0编辑  收藏  举报