Set up CTS automated testing (AOSP 10 or lower)

This page contains CTS set up instructions specific to Android 10 and lower.

Install JDK

  • For Android 9 and 10, install JDK 9.
  • For Android 8 or lower, install JDK 8.

Set first API level

For devices launched with Android 9 or 10, set the ro.product.first_api_level property to a valid value from Codenames, Tags, and Build Numbers.

For devices launched on Android 8.x or lower, unset (remove) the ro.product.first_api_level property for the first build of the product. For all subsequent builds, set ro.product.first_api_level to the correct API level value. This lets the property correctly identify a new product and preserves information about the first API level of the product. If the flag is unset, Android assigns Build.VERSION.SDK_INT to ro.product.first_api_level.

Storage requirements

The CTS media stress tests require video clips to be on external storage (/sdcard).

The required space depends on the maximum video playback resolution supported by the device. See section 5 in the Android Compatibility Definition document for the platform version of the required resolutions.

Here are the storage requirements by maximum video playback resolution:

  • 480x360: 98 MB
  • 720x480: 193 MB
  • 1280x720: 606 MB
  • 1920x1080: 1863 MB

Configure the DUT

This section contains special DUT configuration instructions for AOSP 10 or lower.

Enable USB debugging

In Android 9 or 10, navigate to System > Developer options.

In Android 8 or lower, navigate to Settings > Developer options.

Enable mock locations (AOSP 4.4.x and 5.x)

In Android 5.x and 4.4.x, navigate to Settings > Developer options and enable Allow mock locations.

Set up for accessibility tests (CTS 2.1 R2 - 4.2 R4)

Set up your device (or emulator) to run the accessibility tests with:

  adb install -r
  android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk

Then, navigate to Settings > Accessibility > Accessibility and enable Delegating Accessibility Service.

Set up for device administration test (CTS 6.x or lower)

On devices that declare android.software.device_admin, set up your device to run the device administration test using:

  adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk

Then, in Settings > Security > Select device administrators, enable the two android.deviceadmin.cts.CtsDeviceAdminReceiver* device administrators. Ensure that android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver and any other preloaded device administrators remain disabled.

Set up media files (AOSP 10 or lower)

Video streaming tests for Android 10 or lower require the video files to be on external storage (/sdcard). For more information, see Storage requirements.