Using the AltTester® CLI#
The AltTester® CLI runs the same commands as AltTester® Desktop from a terminal: find objects, tap and type, read text and properties, take screenshots. Use it to explore an app from a script, or let an AI assistant drive it through the AI Extension.
It needs a license that includes the CLI, and AltTester® Desktop 2.3.2 or later; see Licensing.
Getting Started#
When you first start AltTester® Desktop with a compatible license, you’ll be prompted to set up the CLI. Simply click Download to automatically install and configure it for your system.
By default, the CLI is installed to .alttester/CLI/ and is automatically added to your PATH. If you changed the installation path in AltTester® Desktop settings, the CLI will be placed in the path you configured instead. After installation, verify it is available by running:
alttester --version
Set up later from Settings#
If you skip the initial prompt, you can install the CLI later:
Open AltTester® Desktop Settings
Look for the Configure AltTester® AI Extension section
Click Open Configuration Setup to download and install the CLI
Your first session#
Before you start, AltTester® Server must be running, for example from the Start Server tab of
AltTester® Desktop, and your instrumented app must be connected to it. See
Connect to your app.
List the apps connected to the server:
alttester appsConnect to one. With a single app connected,
connectpicks it; otherwise choose it by name, or by the app id from the list:alttester connect --app-name TrashCat
Look at what is on screen.
snapshotsaves the object hierarchy, and--showprints it:alttester snapshot alttester snapshot --show
Find an object, act on it, and read the result:
alttester find PlayButton alttester tap PlayButton alttester get-text --by PATH //Canvas/Header/Title alttester screenshot --path after-tap.png
Disconnect when you’re done:
alttester disconnect
To reach a server on another machine, add --host and --port to any command, such as
alttester apps --host 192.168.1.10. When the server runs in secure mode,
add --use-secure to apps and connect.
How the CLI keeps its connection#
connectstarts a background process that holds the connection to the server, so the commands after it run at once. It exits by itself after 300 seconds without a command; change that with--idle-timeout.While connected, the CLI is a driver on the server, listed as
CLIin theConnected Driverslist of AltTester® Desktop. It takes one of the connections your license allows.Most commands that change the app save a snapshot of the object hierarchy in your project’s
.alttester-cli/folder.alttester snapshot --showprints the latest one, even without a connection. See Snapshots.The CLI updates itself when a new version is out; see Updating the CLI.
Next#
CLI command reference: every command and its options.
AI Extension: let an AI assistant explore the app and write tests through the CLI.
Troubleshooting the CLI:
alttesternot found, a connection that won’t start, a stale background process.