> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tuple.app/llms.txt
> Use this file to discover all available pages before exploring further.

# 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:

<img src="https://mintcdn.com/tuple-0f82e5be/KrzhTF2unbKcB628/images/triggers/simulator.png?fit=max&auto=format&n=KrzhTF2unbKcB628&q=85&s=eadaf3a03532b312f3da853beca59d2d" alt="Trigger simulator" width="815" height="729" data-path="images/triggers/simulator.png" />

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