diagram.mmd — flowchart
App Launch Lifecycle flowchart diagram

The app launch lifecycle describes the sequence of steps the operating system and application code execute from the moment a user taps an app icon — or a notification wakes the process — through to the first interactive screen being rendered on display.

Launch type significantly affects the sequence. A cold start occurs when the app process does not exist in memory: the OS must allocate a new process, load the binary and linked frameworks from disk into memory, and run static initializers before application code begins executing. On iOS this is application(_:didFinishLaunchingWithOptions:); on Android it is Application.onCreate() followed by the launcher Activity.onCreate(). Cold starts are the most expensive and are where slow initialization code has the most user-visible impact — each millisecond spent blocking the main thread here directly delays the first frame.

A warm start occurs when the app process is already in memory (suspended in the background) and is resumed. The OS simply moves it to the foreground; no process creation or binary loading is needed. A hot start is an even lighter variation where the activity or view controller is still in memory and only needs to be brought to the front.

After the entry-point callback fires, the app initializes its dependency injection container, restores any persisted session (reading from the Keychain/Keystore), sets up the navigation stack, and decides which screen to show: onboarding for new installs, the login screen if no session exists, or the main content screen for authenticated returning users. If a cached data set is available, it is loaded immediately so the screen renders with stale-but-fast content while a background refresh runs.

For what happens when the app is launched from a notification or link, see Deep Link Routing and Push Notification Flow. For auth session restoration, see Mobile App Authentication.

Free online editor
Edit this diagram in Graphlet
Fork, modify, and export to SVG or PNG. No sign-up required.
Open in Graphlet →

Frequently asked questions

The app launch lifecycle is the ordered sequence of steps — from the OS creating a process through binary loading, initialisation, session restoration, and navigation setup — that must complete before the user can interact with the first screen.
A cold start allocates a new process, loads the binary from disk, and runs all static initialisers, making it the most expensive launch type. A warm start resumes a suspended process already in memory, skipping process creation and binary loading entirely.
Optimise whenever cold-start time — measured from process creation to first interactive frame — exceeds roughly 400 ms on a mid-range device. Defer non-critical initialisations, move heavy work off the main thread, and pre-load only the data needed for the first screen.
Running synchronous disk or network I/O on the main thread during startup, initialising every SDK eagerly regardless of whether it is needed at launch, and failing to handle the case where a saved session is corrupt or expired are the most common causes of slow or broken launches.
mermaid
flowchart TD A([User taps icon or notification]) --> B{Launch type?} B -- Cold start: process not in memory --> C[OS creates new app process] C --> D[Load binary and frameworks from disk] D --> E[Run static initializers] E --> F[Call didFinishLaunchingWithOptions / Application.onCreate] B -- Warm start: app suspended in background --> G[OS resumes suspended process] G --> H[Call applicationWillEnterForeground / onResume] B -- Hot start: activity still in memory --> I[Bring window to foreground] F --> J[Initialize dependency injection container] J --> K[Read session token from Keychain / Keystore] K --> L{Valid session found?} L -- No --> M[Show onboarding or login screen] L -- Yes --> N[Restore navigation stack] N --> O[Load cached data from local store] O --> P[Render screen with cached content] P --> Q[Trigger background API refresh] Q --> R[Update UI with fresh data] H --> N I --> P M --> S([User sees first interactive screen]) R --> S
Copied to clipboard