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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM