Earlier to ensure that the app's state is completely cleared between tests we used in gradle the command:
testInstrumentationRunnerArguments clearPackageData: 'true'
In gradle 7.0.3 and higher this command has been already deprecated doesn't work:
@Incubating
@Deprecated(message = "Replaced by testInstrumentationRunnerArguments property")
public abstract fun testInstrumentationRunnerArguments(
args: Map<String, String>
): Unit
Deprecated:
Replaced by testInstrumentationRunnerArguments property
Gradle: com.android.tools.build:gradle-api:7.0.3 (gradle-api-7.0.3-sources.jar)
How to clear the state between instrumented tests in gradle now?