Mobile Development 9 min read

Android Application Cold Start Process Overview

The article outlines Android’s cold‑start sequence, describing how the system’s zygote, system_server services, and Activity Manager Service allocate resources, fork a new process, create the Application and Activity objects, render the first UI frame, and replace the placeholder window, helping developers diagnose and optimize launch performance.

OPPO Kernel Craftsman
OPPO Kernel Craftsman
OPPO Kernel Craftsman
Android Application Cold Start Process Overview

With the rise of mobile development, the importance of the Android platform has become increasingly prominent. This article briefly introduces the application startup process on Android, focusing on the cold‑start scenario. It is aimed at developers who already have a basic understanding of Android.

The article is based on Android P; while details may vary across versions, the core logic remains the same.

Types of application start

Cold start The application must complete the full startup sequence: process creation, resource initialization, and UI rendering. This takes the longest time among the three start modes.

Hot start The process is already running, so only the target activity needs to be brought to the foreground, resulting in a fast start.

Warm start The process exists but the activity must be recreated (onCreate is called). The startup time lies between cold and hot start.

The article concentrates on the cold‑start execution flow.

Basic concepts related to app startup

zygote zygote is the parent process of all Android app processes. It is started by the system at boot and remains running. Both 32‑bit and 64‑bit versions exist.

system_server system_server hosts most core system services such as AMS, WMS, and PMS. It is forked from zygote.

AMS (Activity Manager Service) A core service that manages application components and their lifecycles. It runs inside system_server .

WMS (Window Manager Service) Handles window management and UI rendering, also residing in system_server .

PMS (Package Manager Service) Manages app installation, removal, and package information, also part of system_server .

Cold start task sequence

During a cold start, the system performs three initial tasks on the AMS side:

1. Allocate application resources in AMS. 2. Display a blank launch window. 3. Create the application process.

After the process is created, the following steps occur inside the new process:

1. Create the Application object. 2. Start the main thread. 3. Create the main Activity, render it, and display it.

When the first frame is drawn, the blank window is replaced by the app UI, and the user can interact with the app.

Typical cold‑start scenario

The common case is launching an app by tapping its icon on the home screen. The flow is:

1. The Launcher process sends a start request to AMS via startActivity() . The intent contains the target app information.

2. AMS creates an ActivityRecord and shows a blank window.

3. Because the app process does not exist, AMS asks the zygote to fork a new process.

4. The new process runs ActivityThread.main() , registers its remote handle with AMS (the “attach” step), and receives launch/resume commands.

5. AMS invokes realStartActivityLocked() to start the first Activity.

6. The app process creates the Activity object, initializes graphics resources, connects to WMS, and calls the Activity lifecycle callbacks (e.g., onCreate() ).

Key code references (shown as file paths) include:

frameworks/base/core/java/android/app/Activity.java

frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java

frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java

frameworks/base/core/java/android/app/ActivityThread.java

frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

The entryPoint parameter in startProcessLocked() points to ActivityThread , which is the entry point of the application process.

Summary

This article provides a concise overview of the Android application startup process, especially the cold‑start path. Understanding these steps helps developers and performance engineers diagnose launch‑time issues and optimize app startup.

Mobile developmentperformanceAndroidcold startapp launchSystem Services
OPPO Kernel Craftsman
Written by

OPPO Kernel Craftsman

Sharing Linux kernel-related cutting-edge technology, technical articles, technical news, and curated tutorials

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.