Testing and debugging

Testing and debugging

Simulating events during development

While developing a trigger, it’s likely you’ll want to invoke it many times. To make this easier, we’ve given you the ability to simulate each of Tuple’s lifecycle events populated with dummy data:

Trigger simulator

This will invoke the lifecycle event you chose and open a Terminal window displaying all relevant output.

Debugging live triggers

Once your triggers run on actual Tuple calls, you might notice they’re not behaving exactly as you’d like.

To diagnose the issue, take a look at ~/.tuple/triggers/triggers.log. This file contains all of the output from the Trigger Runner, as well as any stdout/stderr from your scripts.

Here’s some sample output. In the example below, we see two scripts running. The first works correctly and exits with status code 0. The second has a typo and reports the issue via STDERR.

# ~/.tuple/triggers/triggers.log

[2023-10-25T12:19:11.447] Got trigger 'screen-share-started', searching for matching user scripts
[2023-10-25T12:19:11.448] Found 2 matching scripts
[2023-10-25T12:19:11.448] Running 'screen-share-started'
[2023-10-25T12:19:11.453] Finished 'screen-share-started' with exit code: 0
[2023-10-25T12:19:11.453] Running 'clean-desktop/screen-share-started'
~/.tuple/triggers/clean-desktop/screen-share-started: line 3: defaulst: command not found
[2023-10-25T12:19:11.458] Finished 'clean-desktop/screen-share-started' with exit code: 127
etc...