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

猜你喜欢

转载自www.cnblogs.com/ajanuw/p/11802990.html