Git Product home page Git Product logo

apk-tools's Introduction

命令行工具集

dart 插件

  1. pubspec.yaml将脚本注册为可执行程序,可以注册多个
# 包名: 脚本名称
executables:
  apk: main
  cert: cert

命令名称就是包名,如注apk: main ,在命令行中直接运行apk <commond> [args]

  1. 进入项目根目录,将文件包注册到全局。也可以在任意目录,--source path [包路径]
# 注册到全局
> pub global activate --source path ./
···
Package apk is currently active at path "D:\xxx\apk_tool".
Installed executables apk and cert.
Activated apk 1.0.0 at path "D:\xxx\apk_tool".

# 查看全局包列表
> pub global list
apk 1.0.0 at path "D:\xxx\apk_tool"
···

# 解除注册
> pub global deactivate apk

  1. 运行脚本,测试命令
> apk
apk tools

Usage: apk <command> [arguments]

Global options:
-h, --help    Print this usage information.

Available commands:
  printcert   print apk cert infomation

Run "apk help <command>" for more information about a command.

native 可执行程序

需要dart2native,如果找不到这个命令,可以在sdk目录中找到dart2native.bat所在目录并配置到环境变量

# 在main.dart同级目录下生成 main.exe
> dart2native  bin\main.dart

# 也可以指定输出文件路径和文件名,或者手动修改文件名
> dart2native  bin\main.dart -o apk.exe

生成文件后,就可以在exe同级目录下执行脚本命令。
将exe文件添加到环境变量path中,就可以在全局执行脚本命令。
注意:命令名称是exe文件的名字,不再是包名,如生成的是main.exe,那命令就是main <commond> [args],生成的是apk.exe,那命令就是apk <commond> [args]

dart2native 参数

# 第一个参数是主Dart文件的路径
> dart2native <main-dart-file> [<options>]

# 定义一个环境声明,可以使用String.fromEnvironment()构造函数读取该声明. 要指定多个声明,请使用多个选项或使用逗号分隔键值对.
-D <key>=<value> or --define=<key>=<value>

# Enables assert statements.
--enable-asserts

# 指定输出类型,其中exe是默认值
-k (aot|exe) or --output-kind=(aot|exe)

# 指定输出文件路径和文件名,若不指定则默认在脚本目录下生成同名exe文件
-o <path> or --output=<path>

# 指定软件包解析配置文件的路径
-p <path> or --packages=<path>

# 显示更多信息
-v or --verbose


apk-tools's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.