# EmulatorSnapshots

# EmulatorSnapshots

<br />

```
@Incubating
public interface EmulatorSnapshots
```

<br />

Known direct subclasses  
[FailureRetention](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/FailureRetention)  

|----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|
| [FailureRetention](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/FailureRetention) | **This interface is deprecated.**Renamed to EmulatorSnapshots |

*** ** * ** ***

Options for configuring Android Test Retention.

When enabled, Android Test Retention automatically takes emulator snapshots on test failures.

## Summary

| ### Public methods |
|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract boolean` | [getCompressSnapshots](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/EmulatorSnapshots#getCompressSnapshots())`()` Enables snapshot compression.                                                                                      |
| `abstract boolean` | [getEnableForTestFailures](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/EmulatorSnapshots#getEnableForTestFailures())`()` Enables automated test failure snapshots.                                                                  |
| `abstract int`     | [getMaxSnapshotsForTestFailures](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/EmulatorSnapshots#getMaxSnapshotsForTestFailures())`()` Maximum number of failures that would be snapshotted.                                          |
| `abstract void`    | [retainAll](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/EmulatorSnapshots#retainAll())`()` Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting)                  |
| `abstract void`    | [setCompressSnapshots](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/EmulatorSnapshots#setCompressSnapshots(kotlin.Boolean))`(boolean compressSnapshots)` Enables snapshot compression.                                               |
| `abstract void`    | [setEnableForTestFailures](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/EmulatorSnapshots#setEnableForTestFailures(kotlin.Boolean))`(boolean enableForTestFailures)` Enables automated test failure snapshots.                       |
| `abstract void`    | [setMaxSnapshotsForTestFailures](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/EmulatorSnapshots#setMaxSnapshotsForTestFailures(kotlin.Int))`(int maxSnapshotsForTestFailures)` Maximum number of failures that would be snapshotted. |

## Public methods

### getCompressSnapshots

```
abstract boolean getCompressSnapshots()
```

Enables snapshot compression. Default to false.  

### getEnableForTestFailures

```
abstract boolean getEnableForTestFailures()
```

Enables automated test failure snapshots. Default to false.  

### getMaxSnapshotsForTestFailures

```
abstract int getMaxSnapshotsForTestFailures()
```

Maximum number of failures that would be snapshotted. Any failures after the first $maxSnapshotsForTestFailures will not have snapshots. Default to 2. Must be \>0  

### retainAll

```
abstract void retainAll()
```

Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting)  

### setCompressSnapshots

```
abstract void setCompressSnapshots(boolean compressSnapshots)
```

Enables snapshot compression. Default to false.  

### setEnableForTestFailures

```
abstract void setEnableForTestFailures(boolean enableForTestFailures)
```

Enables automated test failure snapshots. Default to false.  

### setMaxSnapshotsForTestFailures

```
abstract void setMaxSnapshotsForTestFailures(int maxSnapshotsForTestFailures)
```

Maximum number of failures that would be snapshotted. Any failures after the first $maxSnapshotsForTestFailures will not have snapshots. Default to 2. Must be \>0