Skip to content
Puneetpal Arneja.Start a project
By • Published • Updated

How to Improve Mobile App Startup Time: Practical Wins for iOS & Flutter

Apple’s guidance since WWDC 2019 is to show your first frame within 400ms of the tap, and the watchdog kills any app still launching after about 20 seconds. Google Play flags a cold start of 5 seconds or more as excessive. Most apps sit between those numbers because of work that runs at launch and did not need to.

Below: how I measure launch on iOS and Flutter, the usual causes, and the fixes in the order they pay off. The same eager-initialization problem shows up mid-migration, covered in the SwiftUI migration playbook; for the cross-platform trade-offs behind the Flutter numbers, see Flutter vs React Native.

Measure First: Cold vs Warm Start

Cold and warm starts have different causes and different fixes. Decide which one you are chasing before you open a profiler.

Cold Start

The process does not exist yet. The system maps the binary and its dynamic libraries, runs static initializers, calls UIApplicationMain, then didFinishLaunchingWithOptions, then renders the first frame. Almost all of the avoidable cost lives here.

Target: first frame under 400ms, first useful content under 1s

Warm Start

The process is still in memory and returns to the foreground. Only sceneWillEnterForeground and sceneDidBecomeActive run, so a slow warm start is almost always a token refresh or sync someone put in one of those callbacks.

Target: interactive within 200ms

One trap for home-made timers: since iOS 15 the system may prewarm your app, running the process up to just before main() long before the user taps the icon, so a timer started at process launch reports multi-second starts nobody experienced. Check ProcessInfo.processInfo.environment["ActivePrewarm"] and discard those samples, or use MetricKit, which already accounts for it.

Profiling: Find the Real Bottleneck First

Profile a release build on the slowest device you still support, with the app force-quit first. A debug build on this year’s iPhone tells you nothing about the problem your users have.

iOS: Instruments

  1. In Xcode choose Product, then Profile, and pick the App Launch template. It pairs Time Profiler with a launch-phase track, so pre-main, didFinishLaunching, and first frame show as separate spans.
  2. In the post-main span, sort by weight. The usual suspects are synchronous disk reads, JSON decoding, Core Data setup, image decoding, and SDK initializers on the main thread.
  3. Wrap your own startup steps in OSSignposter intervals so they appear as named regions in the same trace.
  4. For a repeatable number in CI, add a UI test that calls measure(metrics: [XCTApplicationLaunchMetric()]); it launches the app several times and reports mean and deviation.

DYLD_PRINT_STATISTICS, which older guides recommend, stopped working with the dyld rewrite in iOS 15. The App Launch template is the replacement.

Flutter: DevTools

  1. Run flutter run --profile --trace-startup. It writes start_up_info.json to the build directory with timeToFrameworkInitMicros, timeToFirstFrameMicros, and timeToFirstFrameRasterizedMicros.
  2. In DevTools, open the Performance tab and turn on “Track widget builds” to see what the first frame spends its time building.
  3. Wrap your own initialization in Timeline.startSync / Timeline.finishSync from dart:developer.
  4. On Android, adb shell am start -W prints TotalTime for a cold start as the OS sees it, which is what Play Console judges you on.

iOS-Specific Optimizations

Reduce Pre-Main Time (dylib loading)

  • Count your non-system dynamic frameworks. Apple’s guidance since WWDC 2016 is about six or fewer; a CocoaPods project with use_frameworks! often ships thirty.
  • Link statically. Swift packages linked from Xcode are static by default; for CocoaPods use use_frameworks! :linkage => :static. Static code is part of the main binary and costs nothing extra at load.
  • On Xcode 15 and later, enable Create Merged Binary (MERGED_BINARY_TYPE) on the app target. Release builds fold your frameworks into the app; debug builds keep them separate so incremental builds stay fast.
  • Find Objective-C +load methods and C++ static initializers in your code and third-party SDKs. They run before main(); move the work to +initialize or first use.

None of this argues against modularizing. Feature code split into local Swift packages, as in a white-label iOS architecture built on module boundaries, keeps launch cheap as long as those packages link statically rather than as dynamic frameworks.

Optimize AppDelegate & SceneDelegate

  • Start the crash reporter first, synchronously. Everything else in didFinishLaunchingWithOptions is a candidate for deferral.
  • Move analytics, attribution, experiments, and chat SDKs to after the first frame: a one-shot call from the first screen’s viewDidAppear, or a .task on the root SwiftUI view.
  • Be careful with DispatchQueue.global().async for SDK setup. Many SDKs require the main thread to configure, and some crash if two threads touch them during init.
func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    CrashReporter.start()                       // first, synchronous
    Dependencies.shared.bootstrapMinimal()      // only what the first screen needs
    return true
}

// Called once from the first screen after it is on screen
func deferredStartup() async {
    await Analytics.shared.start()
    await FeatureFlags.shared.refresh()
    SupportChat.configureIfNeeded()
}

First Screen Rendering

  • Render something real immediately: the cached list, or a skeleton that matches its layout. A blank screen while data loads reads as a slow launch even when the launch was fast.
  • Keep viewDidLoad free of disk and decode work. Layout has to happen on the main thread; the reading, parsing, and image decoding that feed it do not.
  • Decode images off the main thread with UIImage.byPreparingForDisplay() or byPreparingThumbnail(ofSize:) (iOS 15+) before handing them to a UIImageView.
  • In SwiftUI, load with .task rather than onAppear plus a detached Task. It still runs on the main actor, but it is cancelled when the view disappears, which stops wasted work during fast navigation at startup.

Flutter-Specific Optimizations

Reduce Engine Initialization

  • Do not await a chain of initializers in main() before runApp(); each one delays the first frame. Run a shell that shows cached state and start Firebase, databases, and remote config from the first widget’s initState.
  • In add-to-app projects, create the FlutterEngine in didFinishLaunchingWithOptions and call run() so it is warm before the user reaches a Flutter screen. Use FlutterEngineGroup for more than one engine; engines in a group share resources and start far faster.
  • Deferred components (deferred as imports plus Play Feature Delivery) are Android-only. On iOS the same code compiles and loads eagerly.

Widget Tree Optimization

  • Keep the first-frame tree shallow. IndexedStack builds every child up front, so build heavy tabs on first visit and keep them alive afterwards.
  • Use const constructors wherever the compiler allows. A const widget is built once and skipped on rebuilds, which matters most while the first frames settle.
  • Use ListView.builder or SliverList for anything longer than a screen. A Column of 200 children builds all 200 for the first frame.
  • RepaintBoundary caches a subtree’s rasterized layer, not its build output. It helps when a static region sits beside an animation; it does nothing for build cost.

Release Build Flags

  • Measure only in --profile or --release. Debug builds run Dart in JIT mode with asserts on; their startup numbers bear no relation to what ships.
  • --split-debug-info=<dir> moves symbols out of the binary into files you keep for symbolication. Smaller binary, same crash reports. --obfuscate requires it and is a hardening measure, not a startup one.
  • Icon tree shaking is on by default in release and fails the build on non-constant IconData. Fix the call site rather than passing --no-tree-shake-icons.

Shared Wins: Assets, Network & Initialization

Asset Optimization

  • Keep bundled images in the asset catalog with compression on Automatic, so App Thinning delivers only the scale the device needs. Use vector PDFs or SVGs with “Preserve Vector Data” for icons.
  • Audit unused assets by name. Xcode does not do this; a script that greps the source for each asset name is enough, and the result is usually a surprise.
  • Keep the launch storyboard simple. The system caches a snapshot, but a full-screen 3x image is still decoded the first time, and a launch screen cannot run code to defer anything.
  • Do not parse a large bundled JSON or plist on the launch path. Decode it on first use, off the main thread, or ship it as a binary plist or SQLite file if every launch needs it.

Network & Cache Strategy

  • Show the last cached response immediately and refresh behind it. A first screen that waits on the network is bound by the user’s connection, which you cannot optimize.
  • Give startup endpoints explicit Cache-Control headers. URLCache on iOS and a cache interceptor on dio make stale-while-revalidate a configuration change rather than a feature.
  • Collapse the startup requests. Config, then user, then feed in sequence is the most common hidden second in a launch; one aggregated endpoint, or three requests fired concurrently, removes two round trips.

Lazy Initialization Pattern

Apply this to any service that is not needed on the critical path:

  • Crash reporters are the exception: start them first, synchronously. Deferring them blinds you to launch-time crashes, the most severe class you have.
  • Analytics SDKs: start after the first frame and queue the launch event locally until then.
  • Chat, support, and payment SDKs: initialize when the user opens the help screen or reaches checkout.
  • Feature flags: read cached values synchronously, fetch new ones asynchronously, apply them on the next launch rather than mid-session.

Target Numbers & How to Track Them

MetricTargetBasis
Cold start to first frame (iOS)under 400msApple, WWDC 2019 “Optimizing App Launch”
Cold start to first useful contentunder 1s at p90My working budget, measured on the oldest supported device
Cold start (Android)well under 5sPlay Console flags 5s or more as excessive
Warm start to interactiveunder 200msPast this a resume feels like a relaunch

Track in Production

  • MetricKit: MXAppLaunchMetric delivers daily histograms of time to first draw and resume time, no SDK and no prewarming bias. The Xcode Organizer shows the same data under Launch Time.
  • Firebase Performance: records an automatic app start trace on both platforms, the quickest way to get Flutter percentiles.
  • Your own marker: one event when the first screen has real content, measured from didFinishLaunching rather than process start, tagged with device model and OS. Read p75 and p95, not the mean; the complaint comes from the p95 user on a four-year-old phone.
  • Run the XCTApplicationLaunchMetric test in CI against a baseline and fail the build on a regression over about 10%. Catching it in the PR is cheap; finding it in MetricKit two releases later is not.

Quick Win Priority List

  1. Profile a release build on your slowest supported device with the App Launch template; note which phase is slow before changing anything.
  2. Move every SDK except the crash reporter out of didFinishLaunchingWithOptions.
  3. Render the first screen from cache and refresh behind it.
  4. Count non-system dynamic frameworks; link them statically or merge them.
  5. Collapse sequential startup requests into one, or fire them concurrently.
  6. Put XCTApplicationLaunchMetric in CI and watch MXAppLaunchMetric in production.
Puneetpal Arneja, Senior iOS, Web & Software Developer

Written by

Senior iOS, Web & Software Developer · 13+ years building apps and software

I've shipped 18+ mobile applications across banking, healthcare, and consumer products — including work for Citibank, Apple, PNC, and Albertsons. Everything here comes out of production work, not theory.

Struggling with Slow App Startup?

I offer performance audits for iOS and Flutter apps: profiling, finding the root causes, and implementing the fixes. Most apps have obvious wins left on the table, and the biggest one is usually visible in the first trace.

Related Services & Further Reading