Can android macro benchmark run without clear app's data?
because in my app it require user to accept the license, and the macrobenchmark clear app's data every time when it startup the application.
Can android macro benchmark run without clear app's data?
because in my app it require user to accept the license, and the macrobenchmark clear app's data every time when it startup the application.
To bring your app to a specific state before starting to measure with macrobenchmark, use the setupBlock in the measureRepeated function:
benchmarkRule.measureRepeated(
packageName = PACKAGE_NAME,
metrics = listOf(StartupTimingMetric()),
iterations = 5,
startupMode = StartupMode.COLD,
setupBlock = {
acceptLicense() // <-- Use UIAutomator to perform user actions
}
) {
// Perform benchmark actions
}