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:

  1. Open AltTester® Desktop Settings

  2. Look for the Configure AltTester® AI Extension section

  3. 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.

  1. List the apps connected to the server:

    alttester apps
    
  2. Connect to one. With a single app connected, connect picks it; otherwise choose it by name, or by the app id from the list:

    alttester connect --app-name TrashCat
    
  3. Look at what is on screen. snapshot saves the object hierarchy, and --show prints it:

    alttester snapshot
    alttester snapshot --show
    
  4. 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
    
  5. 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#

  • connect starts 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 CLI in the Connected Drivers list 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 --show prints the latest one, even without a connection. See Snapshots.

  • The CLI updates itself when a new version is out; see Updating the CLI.

Next#