---
title: "Keep cold start under a set budget · Agent Wranglers"
url: https://agentwranglers.se/playbook/mobile-apps/crashes-and-quality/startup-budget
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep cold start under a set budget

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Crashes and quality](https://agentwranglers.se/playbook/mobile-apps/crashes-and-quality.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- ID: MOB-33
- Level: Recommended
- Chapter: [Crashes and quality](https://agentwranglers.se/playbook/mobile-apps/crashes-and-quality)
- Rule: Set a time to first screen budget for a cold start on a mid-range test phone, such as 2 seconds. A benchmark in CI fails the build when a change passes it.
- How: Google Play counts a cold start of 5 seconds or more as excessive. iOS ends an app that takes too long to launch. Do as little as possible before the first screen. Start SDKs late, load data after the first frame and avoid network calls on the launch path. Measure with a benchmark tool, such as Macrobenchmark on Android and `XCTApplicationLaunchMetric` on iOS. Run it on the same device model every time, and compare against the last release. The web counterpart is [fail the build when pages get heavier](https://agentwranglers.se/playbook/website/performance/performance-budget).
- Check: The CI startup benchmark runs 5 cold starts on the reference device. Their median stays within the budget and within 10% of the last release.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Kotlin example

```kotlin
@Test
fun coldStartup() = benchmarkRule.measureRepeated(
    packageName = "com.example.fittrack",
    metrics = listOf(StartupTimingMetric()),
    iterations = 5,
    startupMode = StartupMode.COLD,
) {
    pressHome()
    startActivityAndWait()
}
```

### Plain text example

```swift
func testColdStart() {
    measure(metrics: [XCTApplicationLaunchMetric()]) {
        XCUIApplication().launch()
    }
}
```

## Sources

- [Apple, Reducing your app's launch time](https://developer.apple.com/documentation/xcode/reducing-your-app-s-launch-time)
- [Apple, XCTApplicationLaunchMetric](https://developer.apple.com/documentation/xctest/xctapplicationlaunchmetric)
- [Android vitals, App startup time](https://developer.android.com/google/play/vitals/launch-time)

## Related rules

- [Fail the build when pages get heavier](https://agentwranglers.se/playbook/website/performance/performance-budget) in Website

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/mobile-apps/crashes-and-quality/startup-budget">Agent Wranglers mobile apps playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Stay under the store's crash and freeze limits](https://agentwranglers.se/playbook/mobile-apps/crashes-and-quality/vitals-thresholds)
- Next: [Test every screen with VoiceOver and TalkBack](https://agentwranglers.se/playbook/mobile-apps/crashes-and-quality/screen-reader-tests)
- [Crashes and quality](https://agentwranglers.se/playbook/mobile-apps/crashes-and-quality)
