Stay organized with collections
Save and categorize content based on your preferences.
EmulatorSnapshots
@Incubating interface EmulatorSnapshots
Options for configuring Android Test Retention.
When enabled, Android Test Retention automatically takes emulator snapshots on test failures.
Summary
Public functions |
Unit |
Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting)
|
Public properties |
Boolean |
Enables snapshot compression.
|
Boolean |
Enables automated test failure snapshots.
|
Int |
Maximum number of failures that would be snapshotted.
|
Public functions
retainAll
fun retainAll(): Unit
Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting)
Public properties
maxSnapshotsForTestFailures
var maxSnapshotsForTestFailures: Int
Maximum number of failures that would be snapshotted. Any failures after the first $maxSnapshotsForTestFailures will not have snapshots. Default to 2. Must be >0
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# EmulatorSnapshots\n=================\n\n\n```\n@Incubating interface EmulatorSnapshots\n```\n\n\u003cbr /\u003e\n\nKnown direct subclasses \n[FailureRetention](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/FailureRetention) \n\n|------------------------------------------------------------------------------------------------|----------------------------------------------------------------|\n| [FailureRetention](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/FailureRetention) | **This interface is deprecated.** Renamed to EmulatorSnapshots |\n\n*** ** * ** ***\n\nOptions for configuring Android Test Retention.\n\nWhen enabled, Android Test Retention automatically takes emulator snapshots on test failures.\n\nSummary\n-------\n\n| ### Public functions ||\n|------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [retainAll](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/EmulatorSnapshots#retainAll())`()` Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting) |\n\n| ### Public properties ||\n|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [compressSnapshots](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/EmulatorSnapshots#compressSnapshots()) Enables snapshot compression. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [enableForTestFailures](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/EmulatorSnapshots#enableForTestFailures()) Enables automated test failure snapshots. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [maxSnapshotsForTestFailures](/reference/tools/gradle-api/8.0/com/android/build/api/dsl/EmulatorSnapshots#maxSnapshotsForTestFailures()) Maximum number of failures that would be snapshotted. |\n\nPublic functions\n----------------\n\n### retainAll\n\n```\nfun retainAll(): Unit\n```\n\nCall this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting)\n\nPublic properties\n-----------------\n\n### compressSnapshots\n\n```\nvar compressSnapshots: Boolean\n```\n\nEnables snapshot compression. Default to false. \n\n### enableForTestFailures\n\n```\nvar enableForTestFailures: Boolean\n```\n\nEnables automated test failure snapshots. Default to false. \n\n### maxSnapshotsForTestFailures\n\n```\nvar maxSnapshotsForTestFailures: Int\n```\n\nMaximum number of failures that would be snapshotted. Any failures after the first $maxSnapshotsForTestFailures will not have snapshots. Default to 2. Must be \\\u003e0"]]