Mobile App Launch Profiling
Article Summary
Andrew McKnight from Sentry just solved one of mobile performance monitoring's biggest blind spots. Ever wondered what's actually happening in your app before main() even gets called?
Sentry's engineering team has shipped app launch profiling for iOS and Android, capturing performance data from the moment your app starts executing code. This goes beyond Apple's MetricKit and Instruments by profiling the critical pre-main() execution phase that traditional tools miss entirely.
Key Takeaways
- Profiles app execution before main() and appDidFinishLaunching where SDKs typically initialize
- Captures work hidden from Apple's MetricKit like splash screens and loading states
- Enable with SentryOptions.enableAppLaunchProfiling for automatic subsequent launch profiling
- Integrates with Time to Full Display tracing for complete app start insights
You can now profile real user app launches from the very first line of code execution, revealing performance issues that Apple's own tools don't measure.
About This Article
Apple's MetricKit only measures launch time until the first frame appears. It misses what happens after that, like splash screens and loading spinners, which actually affect how responsive users think the app is.
Sentry built app launch profiling by starting the profiler in the SDK's +[load] methods. This captures execution data before main() runs and connects the profiles with Time to Full Display tracing in App Starts insights.
Developers can now see complete flamechart visualizations of pre-main() execution on real devices. This exposes performance bottlenecks that Apple's tools don't show.