- Latency - time to first frame (TTFF)
- Ready-to-use - time to full display (TTFD)
- Memory after using the app’s core functionality (for example, video streaming)
Setup
To get started, install the following software packages on your development computer:- Amazon Corretto
- Android Studio (make sure to install platform tools during setup)
- Appium
- Set up a path for JAVA_HOME and ANDROID_HOME folders.
- Enable developer mode on the device and enable USB Debugging. For instructions, see .
- Capture the serial number of the attached device. To list the serial numbers of physically attached devices, you can use the Android Debug Bridge (ADB) command
adb devices -l.
Test strategy
During testing, you launch the app and force stop it several times by using the app launcher intent or the Monkey tool. Between each iteration, you must perform certain actions, such as capturing logs, performing navigation actions, capturing timer values from logs, and capturing memory and RAM usage before force stopping the app. This loop continues for the number of iterations you configure. As network conditions, system load, and other factors can impact the test results, use multiple iterations to average out the interference from external factors. To calculate metric averages, Amazon recommends running a minimum number of iterations for the following test categories.| Performance test category | Minimum number of iterations recommended |
|---|---|
| Latency – time to first frame (TTFF) | 50 |
| Ready-to-use – time to full display (TTFD) | 10 |
| Memory | 5 |
Get device type
The following example code shows how to get the device type of the connected device.- Java
- Kotlin
Retrieve component name of the main launcher activity
The following example code shows how to retrieve the component name of the main launcher activity. This method fetches the main activity of the app under test and constructs the component name by combining the names of the app package and main activity.- Java
- Kotlin
Launch an app using the component name of the main launcher activity
Use the following example code to launch an app using the component name of the main launcher activity. The code uses thecomponentName variable defined in the previous section, which creates the component name by combining app package and main activity.
- Java
- Kotlin
Launch an app using the Monkey tool
The following code shows how to launch an app using the Monkey tool.- Java
- Kotlin
Force stop an app
The following example code shows how to force stop an app.- Java
- Kotlin
General commands
The following sections provide examples of commands you can use in performance testing.Memory ADB dump log
The proportional set size (PSS) total is the amount of memory consumed by the app on the device. PSS total is used to calculate the memory consumption of an app when it is in the foreground or background.Write a KPI log file
Use the following example code to write a KPI log file for one iteration.- Java
- Kotlin

