6.4 · The launch path: dyld, initialisers and the first frame

The first impression of an app is the time between the tap and the first frame. Most of that time is spent before your first line of Swift, so staff-level questions ask what the system does and what you control.

Mental model. Launch has two halves: before main (the system loads and links your binary) and after it (your code builds the first screen). You only fully own the second half, but you decide how much work the first half has to do.

The path

From tap to first frame, and what runs when.

  1. Walk through what happens from tapping the icon to the first frame. 6.4.1 · L5
    The system asks the process supervisor to start your app. The kernel executes the binary and hands control to dyld, the dynamic linker, which maps the main…
  2. What does dyld do, and how do static and dynamic linking change launch? 6.4.2 · L5
    dyld is the dynamic linker. It reads the binary’s load commands, maps each dependent dylib (your own frameworks plus system libraries), then performs rebase…

The cost

What makes launch slow, and how to measure and cut it.

  1. Your app launches slowly. How do you find out why and what do you cut? 6.4.3 · L8
    Measure first, on a real device, in a Release configuration. Instruments’ App Launch template splits the timeline into system work, dyld, static initialisers…

More in iOS platform internals