# Retry Strategies

Failed tests can be automatically retried using the `--retry` flag. Retries are free of charge and capped at 2, giving a maximum of 3 total runs per test.

## Usage

```bash
dcd cloud app.apk flows/ --retry 2
```

On failure, DeviceCloud will re-run the test up to the specified number of times, stopping as soon as a run passes. The final status reflects the last run.

## Limitations

* Maximum value is `--retry 2` (3 runs total)
* Only failed test executions are retried — configuration errors (invalid flow files, authentication failures, missing dependencies) will not be retried
* Retries count toward your concurrency limit while running

{% hint style="info" %}
If your test is still failing after 2 retries, reach out on Discord for help diagnosing the root cause.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devicecloud.dev/advanced/retry-strategies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
