一键导入
android-macrobenchmark
Use when evaluating App Startup Time, frame timing, and writing Baseline Profiles.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when evaluating App Startup Time, frame timing, and writing Baseline Profiles.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Handling Bluetooth Low Energy, flow wrappers, and Android 12+ permissions.
Seamless integration of CameraX with Google ML Kit for vision tasks.
Deep-dive skills for banking and healthcare apps.
Use when integrating Google Gemini Nano via AICore for on-device ML.
Automated UIAutomator tests and Hardware mocking setup.
Expanding KMP shared UI to cover Compose Multiplatform edge-cases.
| name | android-macrobenchmark |
| description | Use when evaluating App Startup Time, frame timing, and writing Baseline Profiles. |
| category | performance |
| risk | medium |
| source | community |
| date_added | 2026-04-07 |
| metadata | {"triggers":["@macrobenchmark","baseline profile","app startup time"]} |
App Startup Time and UI performance are crucial. Macrobenchmark allows us to write standard JUnit 4 tests to measure end-to-end user journeys (like app startup or scrolling a list) and automatically generate Baseline Profiles that Android's ART uses to pre-compile critical code.
baseline-prof.txt)com.android.test module. They launch your application by its applicationId externally.app/src/androidTest directory.@RunWith(AndroidJUnit4::class)
class ScrollBenchmark {
@get:Rule
val benchmarkRule = MacrobenchmarkRule()
@Test
fun scrollTimeline() = benchmarkRule.measureRepeated(
packageName = "com.example.app",
metrics = listOf(FrameTimingMetric()),
iterations = 5,
startupMode = StartupMode.COLD
) {
pressHome()
startActivityAndWait()
// Using UIAutomator to find the scrollable list and scroll
val list = device.findObject(By.res("com.example.app", "timeline_list"))
list.setGestureMargin(device.displayWidth / 5)
list.fling(Direction.DOWN)
}
}