Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Measure Android app startup time

Tags:

android

What is the most precise way to measure startup time of an Android app?

By startup time I mean the difference between 2. and 3. :

  1. The app process is not running
  2. User clicks on app icon in the launcher
  3. Main Activity is fully initialized

So I basically need to somehow get time elapsed since JVM started and log it.

like image 869
fhucho Avatar asked Jan 02 '13 15:01

fhucho


People also ask

How does Android measure app startup time?

On the App start-up time page inside Android Vitals (on Google Play console), you can see details about when your app starts slowly from cold, warm, and hot system states. These metrics are automatically calculated, without any development effort.

How is app launch time calculated?

How to retrieve TTID. In Android 4.4 (API level 19) and higher, logcat includes an output line containing a value called Displayed . This value represents the amount of time elapsed between launching the process and finishing drawing the corresponding activity on the screen.

What is app start time in firebase?

App start traceThis trace measures the time between when the user opens the app and when the app is responsive. In the console, the trace's name is _app_start . The collected metric for this trace is "duration".

How do I find my first app launch Android?

There's no reliable way to detect first run, as the shared preferences way is not always safe, the user can delete the shared preferences data from the settings! a better way is to use the answers here Is there a unique Android device ID? to get the device's unique ID and store it somewhere in your server, so whenever ...


1 Answers

I understand I am too late to answer, nonetheless, this precisely answers the question.

This information gets logged on Logcat by default for API version 19 or higher.

From Android 4.4 (API level 19), logcat includes an output line containing a value called Displayed. This value represents the amount of time elapsed between launching the process and finishing drawing the corresponding activity on the screen.

ActivityManager: Displayed com.android.myexample/.StartupTiming: +3s534ms

The key is looking for it in the right place -

If you’re tracking logcat output from the command line, or in a terminal, finding the elapsed time is straightforward. To find elapsed time in Android Studio, you must disable filters in your logcat view. Disabling the filters is necessary because the system server, not the app itself, serves this log.

The extracts are from the documentation.

like image 96
user2520215 Avatar answered Sep 20 '22 04:09

user2520215