AntCubeTool (ACT) provides a set of act commands for creating, building, and previewing Cube applications.
Create a project
act init: Creates a project.
The name fields in the configuration are used to create files or folders and can only contain letters, numbers, underscores (_), and hyphens (-).
➜ ~ act init -h
Usage: act init [options]
Initializes a Cube application in the current folder.
Options:
-h, --help display help for command
Start the service
act prepare: Cleans up historical ports.
act server: Starts the connection listener.
➜ ~ act prepare --help
Usage: act prepare [options]
Prepares the environment.
Options:
-h, --help display help for command
➜ ~ act server --help
Usage: act server [options]
Starts the communication server.
Options:
-h, --help display help for command
On macOS, run these two commands in the same terminal session. Do not close the terminal window until the service has started. When the service starts, the following output is displayed. To run other act commands, open a new terminal window.
➜ ~ act prepare && act server
2021-1-7 16:38:25 [ACT] [INFO] cmd : kill -9 $(lsof -t -i:9001)
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
2021-1-7 16:38:25 [ACT] [INFO] Port cleared.
2021-1-7 16:38:26 [ACT] [INFO] Starting service [30.30.XXX.XXX:9001]
2021-1-7 16:38:26 [ACT] [INFO] Communication channel is ready. Scan the QR code or enter the port number to connect.
2021-1-7 16:38:26 [ACT] [INFO]
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▄▄████ ██▀█▄█▀▀ ▀█ █ █ ▄▄▄▄▄ █
█ █ █ █ ▀█ ▄▄▄▀ ▀▀█▀█▀▀▀ ▀▀▄█ █ █ █
█ █▄▄▄█ █▄ ▄▄▀▄ ▄▀▀▀ ▄ ██▄▀█▄▄█ █▄▄▄█ █
█▄▄▄▄▄▄▄█▄▀▄▀▄▀ █▄▀▄▀▄█▄▀ █ ▀ █▄▄▄▄▄▄▄█
█ ▄ ▀▀▄█ ▀███▄▄██▄█▀█▄ ▀▄ ▄▄█▄█▀▄ ▀▄█
█▀▀▄▀▀█▄▀▀ █▀▀▀ █ ██▀▄█▄ ▄▀ █▀ █▄ ▀▀██
█ █▄▀▄ ▄▄ ▀█ █▀█▀▄ ▀ █▄█ ▄ ▄ ▀ █▄▀ █
█ █▀▀▄ ▄▄▄▀▄█ ▀▄▀▀█▀ ▄ █ ▄▄▀▄█▀▄▄ █▄▀█
█▀█▀▀ ▀▄█▄█▀▄▀▀█ █▀██ ▀▄ ▀▄█▀▄█▄▄ ▀█
█▀ ▄▀ ▄▄▀ █▄▄ ██▄▀▀▄█▄█ █ █▄▄▄██ ▄▄▄▄▄█
███▄█ ▀▄██▄ ▄ ▀█▀ ▀▀▄▄█▀▀█▀▀ ██ ▄█▀█▄█
█ ▀▀▀▄▄▀▄█▀▄▄▄█▀▀█▄▀▄▄ █ ▄██▀ ██▄ ███
██ ▀▀▄█▄▄ █▄▀ █ ▀▄▀▄██▄█ ▄ ▀ ▀█
█▀▄ ▄█▄▄▀███ █▄▀█▀██▄▄ ███▄██▄▀█ █▄█ ▀█
█████▄▄▄█▀▀██▄█ █▀▀▄ ▄ ▄ ▀ ▄▄▄ ▄ ▄▀█
█ ▄▄▄▄▄ ████▀█ ▄█▀ ▀█▄ ▀▄█▀▀ █▄█ █▄ █
█ █ █ █▀█ ██▄▄█▀▄█ █ █▀ █▀█▄ █▀ ▀█
█ █▄▄▄█ █ ▄█▀▀▀ ▀██▀▀ ▄█ █▀▄██▀▄▄▄▀▀███
█▄▄▄▄▄▄▄█▄▄▄▄███▄█▄▄█▄█▄██▄████▄██▄▄▄▄█
2021-1-7 16:38:26 [ACT] [INFO] Routing module started.
2021-1-7 16:38:26 [ACT] [INFO] Service started. Do not close the terminal window.
Establish a connection
To establish a connection, use the Ant Dynamic Card-Developer Tool. For more information, see:
Compile the project
act build: Compile the project.
➜ ~ act build --help
Usage: act build [options] [path]
Compiles the card application in the specified path. If no path is specified, the current path is used.
Options:
-p, --path [v] The path to compile. Compatible with older tools. [Deprecated: Use build [path] directly.]
-a, --all <v> Batch compile. Compatible with older tools. [Deprecated: Use build [path] --batch.]
--batch Specifies whether to use batch processing mode. (default: false)
--watch Specifies whether to enable real-time compilation. Not supported in batch processing mode. (default: false)
-h, --help display help for command
With the --watch parameter enabled, ACT monitors file changes across the project directory and automatically triggers compilation when a file is saved.
When real-time compilation is enabled, do not close the terminal window.
Preview the project
To preview the project, use the Ant Cube Card-Developer Tool. For more information, see:
Real-time preview
To perform a real-time preview, use the Ant Cube Card-Developer Tool. For more information, see:
View the current connection QR code
act qrcode: Displays the QR code for the current connection. Run this command to reconnect a Playground device. If act server has been running for a long time and the original QR code has scrolled out of view, use this command to display it again.
➜ ~ act qrcode --help
Usage: act qrcode [options]
Displays the QR code for connection.
Options:
-o, --onlyInfo Outputs only the QR code content. This is disabled by default. When enabled, the emulated QR code image is not displayed. (default: false)
-p, --pure Outputs only the content without formatting information, such as time and prefixes. (default: false)
-h, --help display help for command
You can pass parameters to output only the QR code content string, which allows other ACT-based tools to retrieve it programmatically.
act qrcode -o -p
View currently connected devices
act device: Lists the currently connected devices. Use this command to verify that Playground devices are connected to the server. Preview features such as preview and alive require at least one connected device.
➜ ~ act device --help
Usage: act device [options]
Displays the list of currently connected devices.
Options:
-h, --help display help for command
View help
-
View all supported commands.
act -h
-
View the parameters for a specific command.
act [command] -h
View information
act info