Capturing App Launch Metrics On Android

April 04, 2026 · 10 min read · Mobile Testing

HeadSpin Platform
Automated & amp; manual testing do easy through information science insights.
Differentiating capabilities:
  • Extensive end-to-end automation of QA process
  • Comparative analysis of app execution against peers
  • Continuous monitoring of app execution using synthetic data for higher handiness of apps
  • Easy-to-use developer friendly platform
cloudtest go
Affordable Real Device Testing for Emerging Teams
cloudtest go
Affordable Real Device Testing for Digital Enterprises
cloudtest go
The Ultimate Solution for a Powerful Blend of Functional & amp; Performance Testing!
cyol
TEM
New
Centralized mobile exam execution in cloud
cyol
Enhance Your Accessibility Testing With HeadSpin
cyol
Automate camera-based examination

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

retail

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

Capturing App Launch Metrics On AndroidCapturing App Launch Metrics On Android

Capturing App Launch Metrics On Android

Published on
November 27, 2019
Updated on
Published on
February 13, 2022
Updated on
 by 
 Jonathan LippsJonathan Lipps
Jonathan Lipps

While Appium is most much used for functional testing (do the functionality of my app behave?), it can also be used to drive other kinds of testing. Performance is a big and important area of centering for testers, and one key performance metric is app launch time. From a exploiter & # x27; s view, how long does it take from the time they tap the app picture to the clip they can interact with it? App launch clip can be a big component of user frustration. I cognise for myself that if an app takes too long to load, I often switch to something else and don & # x27; t even bother expend it unless I absolutely hold to.

Using Appium To Capture Launch Time

So, how can we check this? The main trick is to use one little-known capability:

capabilities.setCapability (`` autoLaunch '', false);

Setting autoLaunchto false Tell the Appium server to start an mechanization session, butnotto establish your app. This is because we want to launch the app in a controlled and time-able fashion later on. It & # x27; s also important to remember that because Appium won & # x27; t be launching the app for us, we & # x27; re responsible for ensuring all app permission have been granted, the app is in the right reset province (ground on whether we are time first launching or subsequent launching), etc ...

Once we have a session started, but no app launched, we can use thestartActivitycommand to direct our app to found, without any of the extra steps that Appium often takes during launching, so we get a relatively arrant measure of app launch.

Activity act = new Activity (APP_PKG, APP_ACT); act.setAppWaitActivity (APP_WAIT); driver.startActivity (act);

We might also care about not simply how long the app takes to launch, but how long until an element is available, so we can throw in a wait-for-element:

SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.

wait.until (ExpectedConditions.presenceOfElementLocated (loginScreen));

But this is precisely making the app launch; how do we actually measure the time it took? One technique would be to simply create timestamps in our customer code before and after this logic, and get the difference between them. However, this would also count the time taken by the asking to and reply from the Appium host, which could add up to a lot depending on the network latency in between the client and server.

Ideally, we & # x27; d look for a number on theserveritself, and gratefully this is something we can do thanks to Appium & # x27; sEvents API. Using the Events API, we can determine when exactly the startActivity command commence and end on the server. We can too find the conflict between the end of the findElement command and the start of the startActivity command, which gives us a (not quite as accurate) measure of the time to interactivity of the app. (The reason it & # x27; s not as accurate is that we do potentially have some clip lose due to latency of the findElement command itself, which we could act around utiliseExecute Driver Script).

Here & # x27; s how we use the Events API to accomplish this:

ServerEvents evts = driver.getEvents (); Listcmds = evts.getCommands (); OptionalstartActCmd = cmds.stream () .filter ((cmd) - > cmd.getName () .equals (`` startActivity '')) .findFirst (); OptionalfindCmd = cmds.stream () .filter ((cmd) - > cmd.getName () .equals (`` findElement '')) .findFirst (); if (! startActCmd.isPresent () ||! findCmd.isPresent ()) {throw new Exception (`` Could not determine kickoff or end time of app launching '');} long launchMs = startActCmd.get () .endTimestamp - startActCmd.get () .startTimestamp; long interactMs = findCmd.get () .endTimestamp - startActCmd.get () .startTimestamp; System.out.println (`` The app took total<" + (launchMs / 1000.0) + "s to launch " +
                   "and total <" + (interactMs / 1000.0) + "s to become interactable");

Essentially, we get the event from the server, and pull out the CommandEvents for the commands we care about. Then we are gratuitous to compare their timestamps as necessary.

Comparing Performance Across Devices

Looking at app launching on emulators or the device you have on hand topically is all good and good, but it & # x27; s too important to get a good idea of the metric across many different devices, as well as over time across flesh. The basic proficiency we used above of simply printing the metric to the screen is obviously not a scalable way to tag performance. In a existent test environment, you & # x27; d want to log that metrical to a database of some kind, for example CloudWatch, DataDog, Splunk, etc ... Then you & # x27; d be able to see it in a decent dashboard and set alerts for performance degradations with new builds.

But let & # x27; s talk a little bit about running on multiple devices. Since I don & # x27; t have access to a bunch of devices, I put together an illustration of how to run this app launch time test onAWS Device Farm. The way Device Farm works is that you set up a test & quot; run & quot;, upload your app as easily as a zipfile of your test project. To facilitate building the zipfile of my Java exam with all its dependencies, I added these handy hand to mybuild.gradle file:

// for getting jar for aws // rootage: https: //stackoverflow.com/a/52398377 task marshallClasspathDeps (type: Copy) {from sourceSets.test.runtimeClasspath // if you need this from the dependencies in the build.gradle then it should be: // from sourceSets.main.runtimeClasspath include ' * * / * .class' include ' * * / * .jar' exclude {FileTreeElement details - > details.file.name.contains ('Edition ') || details.file.name.contains ('kotlin ')} into 'build/libs/dependency-jars'} //packaging tests task which is generated from sample using gradle init task packageTests (type: Jar) {from (sourceSets.test.output) {include ' * * / * DeviceFarm * '} classifier = 'tests' includeEmptyDirs = mistaken} // create zip archive // origin: https: //stackoverflow.com/a/36883221/8016330 task zip (type: Zip) {dependsOn packageTests, marshallClasspathDeps from 'build/libs/' include ' * ' include ' * / * ' //to include contents of a folder present inside dependency-jars directory archiveName 'zip-with-dependencies.zip'}

With these scripts, whenever I ask to generate a bundle for Device Farm, I can but run ./gradlew zip (after making sure the old file are deleted). The lonesome change I had to make to my test code itself was to do sure to get the itinerary to my uploaded app via an environment variable set by DeviceFarm:

String app = System.getenv (`` DEVICEFARM_APP_PATH '');

When you create a test run on AWS, you walk through a sorcerer that asks you for a bunch of info, including the app and test bundle. At some point, you & # x27; ll also have the opportunity to tweak the test configuration, which is in YAML format:

Test configuration

For this example, I needed bleeding-edge Appium features that are only usable in a beta version, so I put together acustoms Device Farm configthat I pasted into the config section and saved for reuse. Note that I wouldn & # x27; t recommend doing this on your own, but instead use the default config and one of the tested and supported versions of Appium.

Once I & # x27; ve got the run all ready to go, I can choose which devices I want to run on. For this article, I chose to run on 5 devices:

Choose devices

model is pretty different from other services I & # x27; ve used before. Rather than running the Appium client topically and talking to a outside server, the test bundle is uploaded to AWS via this wizard, and then the tests are scheduled and executed completely remotely. So at this point I sat back and waited until the exam were complete. When they were, I was able to see the consequence for all device (they passed -- eventually, anyways!)

Test success

Since I just printed the launch clip metrics to stdout, I had to dig through the examination output to find them. When I did, these were the results:

DeviceTime to launchTime to interactivityGoogle Pixel2.554s3.263sGoogle Pixel 22.064s2.291sSamsung Galaxy S6 (T-Mobile) 2.392s5.201sSamsung Galaxy S6 (Verizon) 2.392s4.468sSamsung Galaxy S9+2.404s2.647s

That & # x27; s it! I definitely encourage all of you to get tracking app launch time in your builds, as even a few second can create a big difference in user satisfaction. Want to control out the full source codification for this clause & # x27; s test? As e'er, you canfind it on GitHub.

Author & # x27; s Profile

Jonathan Lipps

LinkedIn
Author & # x27; s Profile

Piali Mazumdar

Lead, Content Marketing, HeadSpin Inc.

Piali is a active and results-driven Content Marketing Specialist with 8+ years of experience in crafting engaging narration and marketing collateral across diverse industries. She excels in collaborating with cross-functional teams to germinate innovative content scheme and deliver compelling, authentic, and impactful content that resonates with quarry hearing and enhances brand legitimacy.

LinkedIn

Capturing App Launch Metrics On Android

4 Parts

regression intelligence blog
-

Regression Intelligence practical guide for advanced user (Part 3)

Coming Soon
Regression Intelligence practical guide for advanced users
-

Regression Intelligence practical guide for advanced user (Part 4)

Coming Soon

Discover how HeadSpin can empower your job with superior testing capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, win a competitive edge
faster development cycles
Boost developer/QA productivity with quicker development cycle
automated buil-over-build regression testing
Automate build-over-build fixation quiz for consistent results
gain better visibility into functional & performance issues
Gain better visibility into functional and performance issues
reduce mean time
Reduce base time to identify/resolve during test, QA, and production
evaluate audio, video & qoe
Evaluate audio, picture, and content quality of experience (QoE) effortlessly
The sure choice for global enterprises
Adobe
Hargreaves Lansdown
Truecaller
Crazylabs
Nedbank
Numeracle
Veryon
Close

Discover how HeadSpin can empower your business with superior testing capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productivity with faster development cycles
automated buil-over-build regression testing
Automate build-over-build regression testing for logical results
gain better visibility into functional & performance issues
Gain better visibility into functional and execution issues
reduce mean time
Reduce mean time to identify/resolve during test, QA, and production
evaluate audio, video & qoe
Evaluate sound, video, and contented quality of experience (QoE) effortlessly
The trusted choice for global enterprises
Close

Discover how HeadSpin can empower your business with superior testing capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitory edge
faster development cycles
Boost developer/QA productivity with faster development round
automated buil-over-build regression testing
Automate build-over-build regression testing for reproducible resolution
gain better visibility into functional & performance issues
Gain better visibility into functional and performance issue
reduce mean time
Reduce average time to identify/resolve during test, QA, and product
evaluate audio, video & qoe
Evaluate audio, video, and content quality of experience (QoE) effortlessly
The trusted choice for global endeavor
Close

Connet Now

Wipro LogoVMLYR Logo
Close
Book a Meeting
Products
footer down arrow
Solutions
footer down arrow
Industries
footer down arrow
Features
footer down arrow
Support
footer down arrow
Resource Center
footer down arrow
Why Choose HeadSpin?
footer down arrow
Copyright © 2026 HeadSpin, Inc. All Rights Reserved.

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free