This topic describes the act commands for common scenarios in AntCubeTool (ACT).
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 commandStart the service
act prepare: Cleans up historical ports.
The act server Enables 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 commandOn macqOS, run these two commands in the same terminal session. After running the commands, do not close the terminal window until the service has started. When the service starts, the following information is displayed. To run other act commands, you must 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
Establish a connection using 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 commandWhen the --watch parameter is configured, the real-time compilation is enabled, then the ACT will monitor file changes throughout the entire project directory and automatically trigger compilation when a file is saved.
When real-time compilation is enabled, do not close the terminal window.
Preview the project
Preview the project using the Ant Cube Card-Developer Tool. For more information, see:
Real-time preview
Perform a real-time preview using 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. Use this command when you need to reconnect a Playground device. If the `act server` command has been running for a long time, the log output may be too long to find the original QR code. In this scenario, you can use the qrcode command to display the QR code 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 commandYou can configure the parameters to output only the QR code content string. This allows other tools based on ACT to retrieve the QR code content.
act qrcode -o -pView currently connected devices
act device: Queries the currently connected devices. You can use this command to check whether any Playground devices are connected to the server. Preview features, such as `preview` and `alive`, do not work if no devices are connected.
➜ ~ act device --help
Usage: act device [options]
Displays the list of currently connected devices.
Options:
-h, --help display help for commandView help
You can view the supported instruction set.
act -h
View the parameters related to the command.
act [command] -h
View information
act info