Код: Выделить всё
@RunWith(AndroidJUnit4::class)
@LargeTest
class BaselineProfileGenerator {
@get:Rule
val rule = BaselineProfileRule()
@Test
fun generate() {
// This example works only with the variant with application id `com.app.myapp`."
rule.collect(
packageName = "com.app.myapp",
// See: https://d.android.com/topic/performance/baselineprofiles/dex-layout-optimizations
includeInStartupProfile = true,
maxIterations = 5
) {
// This block defines the app's critical user journey. Here we are interested in
// optimizing for app startup. But you can also navigate and scroll through your most important UI.
// Start default activity for your app
pressHome()
startActivityAndWait()
Log.d("bs", "generate: $iteration")
}
}
}
< /code>
Я пробовал чистый проект и признание кэшами, но ничего не сработало.
Я использую физическое устройство - Samsung Galaxy S22 (версия Android 14) для работы генератора профилей. '/data/misc/profman/com.app.myapp-primary.prof.txt' приложения процессы приложений. Androidx.benchmark.macro.baselineProfileskt.ExtractProfile (BaselineProfiles.kt: 219)
at aterroidx.benchmark.macro.baselineplieskt.collect (baselineprofiles.kt: 92)
at Androidx.benchmark.macro.junit4.baselineProfilerule.collect (BaselineProfilerule.kt: 137)
at aterroidx.benchmark.macro.junit4.baselineprofilerule.collect $ default (baselineprofilerule.kt: 127)
com.example.baselineprofile.baselineprofilegenerator.generate (BaselineProfileGenerator.kt: 48)
48th Line - это правило.>
Подробнее здесь: https://stackoverflow.com/questions/797 ... -be-either
Мобильная версия