Testing Startup Time of an Advertising SDK on Android
This article explains the concepts of cold, warm, and lukewarm Android app launches, outlines a testing methodology for measuring SDK startup times using ADB commands, and discusses practical considerations, test scenarios, and common pitfalls encountered during performance testing.
The author, responsible for testing a commercial advertising SDK, describes how media partners often report performance issues, especially concerning app launch time, and proposes a systematic approach to evaluate startup performance from the SDK perspective.
Startup Time Concepts : Android app launches can be classified as cold start, warm (hot) start, lukewarm start, and first launch. Cold start occurs when the app process does not exist (e.g., after device boot or system‑killed), requiring full initialization. Warm start reuses existing processes, bringing the activity to the foreground with minimal overhead. Lukewarm start lies between the two, involving a subset of cold‑start operations.
Test Plan : The author selects three scenarios—first cold start, subsequent cold start, and warm start—to measure launch time, focusing on minimizing demo impact. Key reasons include the need to fetch cloud configuration and ad resources during cold starts, while warm starts avoid such initialization.
Test environment considerations include using a pure Android device (e.g., Nexus), varying network conditions (cellular, Wi‑Fi, weak network), single‑ vs multi‑process modes, pre‑loading of splash‑ad APIs, and the size of ad assets that may compete for resources.
Testing Commands :
adb shell am –W [packageName]/[packageName.MainActivity]
After execution, three timing values are returned: ThisTime, TotalTime, and WaitTime. For SDK evaluation, TotalTime is used as the primary metric.
Example shell script snippet for cold start extraction (originally used but problematic):
adb shell am start -W $PackageName/$ActivityName | grep TotalTime | awk -F ' ' '{print $2}' | tr -d "\r"
The author notes that repeated runs are needed to mitigate interference from other apps, recommending removal of highest and lowest values before averaging.
Issues Encountered : An awk syntax error caused failures when extracting TotalTime, highlighting the importance of correct shell scripting.
Overall, the article provides a practical guide for measuring Android SDK launch performance, emphasizing proper test setup, scenario selection, and data collection techniques.
360 Quality & Efficiency
360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.