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 methods
|
abstract Unit |
Call this function to take unlimited number of test failure snapshots (will ignore
maxSnapshotsForTestFailures setting)
|
Properties
|
abstract Boolean |
Enables snapshot compression.
|
abstract Boolean |
Enables automated test failure snapshots.
|
abstract Int |
Maximum number of failures that would be snapshotted.
|
Public methods
retainAll
abstract fun retainAll(): Unit
Call this function to take unlimited number of test failure snapshots (will ignore
maxSnapshotsForTestFailures setting)
Properties
compressSnapshots
abstract var compressSnapshots: Boolean
Enables snapshot compression. Default to false.
enableForTestFailures
abstract var enableForTestFailures: Boolean
Enables automated test failure snapshots. Default to false.
maxSnapshotsForTestFailures
abstract 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@Incubating interface EmulatorSnapshots\n```\n\n|--------------------------------------------------|\n| [com.android.build.api.dsl.EmulatorSnapshots](#) |\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [FailureRetention](/reference/tools/gradle-api/7.1/com/android/build/api/dsl/FailureRetention) |------------------------------------------------------------------------------------------------|-------------------------------------------------| | [FailureRetention](/reference/tools/gradle-api/7.1/com/android/build/api/dsl/FailureRetention) | Options for configuring Android Test Retention. | |\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 methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [retainAll](#retainAll())`()` Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshotsForTestFailures setting) |\n\n| ### Properties ||\n|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [compressSnapshots](#compressSnapshots:kotlin.Boolean) Enables snapshot compression. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [enableForTestFailures](#enableForTestFailures:kotlin.Boolean) Enables automated test failure snapshots. |\n| abstract [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [maxSnapshotsForTestFailures](#maxSnapshotsForTestFailures:kotlin.Int) Maximum number of failures that would be snapshotted. |\n\nPublic methods\n--------------\n\n### retainAll\n\n```\nabstract fun retainAll(): Unit\n```\n\nCall this function to take unlimited number of test failure snapshots (will ignore\nmaxSnapshotsForTestFailures setting)\n\nProperties\n----------\n\n### compressSnapshots\n\n```\nabstract var compressSnapshots: Boolean\n```\n\nEnables snapshot compression. Default to false. \n\n### enableForTestFailures\n\n```\nabstract var enableForTestFailures: Boolean\n```\n\nEnables automated test failure snapshots. Default to false. \n\n### maxSnapshotsForTestFailures\n\n```\nabstract var maxSnapshotsForTestFailures: Int\n```\n\nMaximum number of failures that would be snapshotted. Any failures after the first\n$maxSnapshotsForTestFailures will not have snapshots. Default to 2. Must be \\\u003e0"]]