Настройте автоматическое тестирование CTS

Before you can execute automated CTS tests, prepare your physical environment, set up your workstation, and configure the device you're testing.

Создание физической среды

Certain CTS tests require the use of external devices to be set up near the DUT. To set up your physical environment:

  1. If your DUT supports Bluetooth LE, place at least three Bluetooth LE beacons within 5 meters of the DUT for Bluetooth LE scan testing. Additionally:

    • The beacons don't need to be configured or emit anything specific.
    • The beacons can be any kind, including iBeacon, Eddystone, or even devices simulating BLE beacons.
  2. Place the DUT in front of a scene, such as a wall or the ceiling, at a distance equivalent to the DUT's minimum focus distance. Additionally:

    • Освещение в месте проведения эксперимента должно быть достаточным, чтобы тестируемые датчики могли достигать и поддерживать максимально заданное целевое количество кадров в секунду (FPS), указанное в CONTROL_AE_TARGET_FPS_RANGE .
    • This set up applies to all camera sensors reported by getCameraIdList as the test iterates over the listed devices and measures performance individually.
    • If the DUT supports external cameras, such as USB webcams, plug in an external camera when running CTS. Otherwise, the CTS tests fail.
  3. Если ваше тестируемое устройство поддерживает глобальную систему позиционирования (GPS) или другую глобальную навигационную спутниковую систему (GNSS), подайте на него сигнал GNSS с подходящим уровнем сигнала для приема и расчета местоположения. Дополнительно:

    • GPS-приемник должен соответствовать стандарту ICD-GPS-200C.
    • The GNSS signal can be of any type, including a satellite simulator or a repeater of outdoor signals.
    • You can place the DUT close to a window so that it can directly receive enough GNSS signal from a satellite.
  4. Verify that your Wi-Fi network supports IPv4 and IPv6, has an internet connection with DNS for IPv4 and IPv6, supports IP multicast, and can treat the DUT as an isolated client .

    If you don't have access to a native IPv6 network, an IPv6 carrier network, or a VPN to pass IPv6 tests, use a Wi-Fi AP and an IPv6 tunnel.

  5. Verify that the DUT has the UP , BROADCAST , and MULTICAST flags set on the Wi-Fi interface.

  6. Verify that the Wi-Fi interface has IPv4 and IPv6 addresses assigned. To check the Wi-Fi interface properties, run adb shell ifconfig .

  7. Если ваше тестируемое устройство поддерживает Wi-Fi STA или одновременную работу STA , настройте как минимум две сети Wi-Fi. Эти сети Wi-Fi должны работать в разных диапазонах с разными SSID или в одном и том же SSID с разными BSSID.

  8. If your DUT supports Wi-Fi round trip time (RTT) , set up a device that supports Wi-Fi RTT:

    1. Place the Wi-Fi RTT device within 40 feet of the DUT.
    2. Включите устройство Wi-Fi RTT.

    Here are two recommended devices supporting Wi-Fi RTT: - Google Wifi - Compulab's fitlet2 access point (set to 40 MHz bandwidth at 5 GHz).

Настройте свой настольный компьютер

Перед запуском автоматизированных тестов CTS убедитесь, что ваш настольный компьютер соответствует требованиям к оборудованию и операционной системе, а также имеет установленное необходимое программное обеспечение, как описано в следующих разделах.

Соответствует требованиям к оборудованию

Your CTS desktop machine should meet or exceed these hardware requirements:

  • 64-битная система x86

  • At least 256 GB of free disk space to accommodate the increased number of CTS test cases and an increase in Java heap space reservation in Tradefed

  • Минимум 32 ГБ оперативной памяти.

Соответствует требованиям операционной системы

  • Your development machine must run a 64-bit Linux distribution with GNU C Library (glibc) 2.17 or higher.

  • The Operating System language should be set to "English" to allow CTS to resolve the path correctly.

Установите программное обеспечение для настольных компьютеров.

Для установки соответствующего программного обеспечения для CTS на настольный компьютер:

  1. Install the FFmpeg package version 5.1.3 or higher.

  2. Install the most recent versions of Android Debug Bridge (adb) and Android Asset Packaging Tool (AAPT2) and add the location of those tools to the system path of your machine:

    1. Для установки инструмента командной строки sdkmanager следуйте инструкциям в начале документации по SDK Manager . Ссылка для загрузки инструментов командной строки находится в разделе « Только инструменты командной строки» внизу страницы загрузки Android Studio .
    2. Update your system path to include the location of the newly installed sdkmanager .
    3. Using sdkmanager , install the latest platform-tools and build-tools packages. These packages contain adb and AAPT2. For information on installing packages, see Install packages .
    4. Update your path to include the location of the newly installed adb and AAPT2 tools.
    5. Убедитесь, что adb и AAPT2 добавлены в переменную PATH.
  3. Install the proper version of Java Development Kit (JDK) :

  4. For Android 13 and 14, install virtualenv . The virtualenv tool is required for multidevice tests.

  5. To verify that Python is installed, type python3 . The Python version and date should appear indicating python is properly installed.

  6. Download and open the CTS packages from Compatibility Test Suite downloads that match your devices' Android version and all the application binary interfaces (ABIs) that your devices support.

  7. Загрузите и откройте последнюю версию медиафайлов CTS . Медиафайлы включают видеоклипы из Big Buck Bunny , авторские права на которые принадлежат Blender Foundation и распространяются по лицензии Creative Commons Attribution 3.0 .

  8. (необязательно) При первом запуске CTS происходит динамическая загрузка некоторых файлов CTS, связанных с основной веткой. В зависимости от скорости вашего интернет-соединения, эта загрузка может увеличить время работы CTS на 10 минут и более.

    Чтобы избежать дополнительного времени выполнения CTS, вы можете загрузить файлы CTS, относящиеся к основной ветке, перед запуском CTS. Информацию о загрузке файлов CTS, относящихся к основной ветке, см. в разделе «Загрузка файлов CTS, относящихся к основной ветке» .

Подготовьте тестируемое устройство

After setting up your desktop machine, you must set up and configure the DUT.

Настройте тестируемое устройство (DUT).

Для настройки тестируемого устройства:

  1. Убедитесь, что тестируемое устройство работает на образе системы, основанном на заведомо совместимой пользовательской сборке (Android 4.0 или выше), указанной в кодовых именах, тегах и номерах сборок , и использует вариант user сборки. Дополнительную информацию о вариантах сборки см. в разделе «Выбор целевого устройства» .

  2. Если на тестируемом устройстве установлена ​​версия Android 13 или выше, убедитесь, что в параметре ro.product.first_api_level задан уровень API, с которым устройство было выпущено на рынок. Чтобы установить это значение, внесите следующие изменения в файл device.mk :

    PRODUCT_SHIPPING_API_LEVEL := 21
    

    Некоторые требования CTS зависят от версии программного обеспечения, с которой устройство изначально поставлялось. Например, устройства, изначально поставляемые с более ранними версиями, могут быть исключены из системных требований, применяемых к устройствам, поставляемым с более поздними версиями. Допустимые значения уровня API см. в разделе «Кодовые имена, теги и номера сборок» . Дополнительную информацию о параметре ro.product.first_api_level см. в разделе «Уровень API поставщика» .

    For Android 10 or lower, see Set up CTS (AOSP 10 or lower) .

  3. Если ваше устройство поддерживает управление пакетами APEX:

    1. Download the APEX shim package for your specific Android version and hardware architecture. The left two columns in shim packages table provide links to the package to download.
    2. Скопируйте загруженный пакет в /system/apex .
    3. Rename the file to com.android.apex.cts.shim.apex .
  4. If your device doesn't support APEX package management:

    1. Download the APEX shim packages for your specific Android version and hardware architecture. The right two columns in the shim packages table provide links to the packages to download.
    2. Скопируйте файл CtsShim.apk в папку /system/app/
    3. Переименуйте файл CtsShim.apk в CtsShimPrebuilt.apk
    4. Скопируйте файл CtsShimPriv.apk в папку /system/priv-app/
    5. Rename the CtsShimPriv.apk to CtsShimPrivPrebuilt.apk
  5. If your device reports more than one secure element:

    1. Скачать google-cardlet.cap .
    2. Copy the downloaded file to /data/uicc/cardlets/ .
  6. Если ваше устройство сообщает о наличии более одного защищенного элемента, установите пример апплета во встроенный защищенный элемент (eSE) тестируемого устройства или в SIM-карту, используемую тестируемым устройством. Для получения дополнительной информации см. тест CTS для защищенного элемента .

  7. If your device doesn't have an embedded screen, connect a screen to the device.

  8. Если устройство имеет слот для карты памяти, вставьте пустую SD-карту. Используйте SD-карту, поддерживающую шину сверхвысокой скорости (UHS) с емкостью SDHC или SDXC, или карту со скоростным классом 10 или выше, чтобы убедиться, что она может пройти проверку CTS.

  9. Если устройство имеет слоты для SIM-карт, вставьте активированную SIM-карту в каждый слот. Если устройство поддерживает SMS, каждая SIM-карта должна иметь собственное поле для номера. Для устройств под управлением Android 12 или выше все SIM-карты должны поддерживать хранение сокращенных номеров набора (ADN). GSM и USIM-карты со специальным файлом для телекоммуникаций (DF Telecom ) удовлетворяют этому требованию.

  10. Verify that your device has a SIM with CTS carrier privileges meeting the requirements specified in Prepare the UICC .

Настройте тестируемое устройство (DUT).

Use the following steps to configure your DUT for use with CTS.

На тестируемом устройстве:

  1. Сброс настроек устройства до заводских.

  2. Set the device's language to English (United States) .

  3. If the device supports customizing default fonts, verify the default sans-serif font family is set to Roboto .

  4. If there's a GPS or a Wi-Fi or mobile network feature on the device, enable the location setting.

  5. Подключитесь к сети Wi-Fi, поддерживающей IPv6, способной рассматривать тестируемое устройство как изолированный клиент и имеющей подключение к интернету. Пояснения к изолированным клиентам см. в разделе «Настройка физической среды» .

  6. Verify that there isn't a lock pattern or password set.

  7. Включить отладку по USB:

    1. Navigate to Settings > About phone and tap Build number seven times. The Developer options appears within the System settings category.

    2. Нажмите «Отладка по USB» .

    To enable USB debugging on Android 10 or lower, see Set up CTS (AOSP 10 or lower) .

  8. Установите время в 12-часовом формате.

  9. Включите параметры разработчика > Не засыпайте .

  10. Отключить проверку USB-накопителя:

    1. Перейдите в раздел «Параметры разработчика» .

    2. Нажмите «Проверить приложения через USB» .

  11. В Android 13 и более поздних версиях включите имитацию модема:

    1. Перейдите в раздел «Параметры разработчика» .

    2. Нажмите «Разрешить имитацию модема» .

    This setting is required for specific telephony tests.

На настольном компьютере:

  1. Launch the browser and dismiss any startup or setup screen.

  2. Connect the DUT to the desktop machine using a USB cable.

  3. If the system prompts you to accept an RSA key allowing debugging through this computer, click Allow USB debugging .

  4. Set Roboto2 as the sans-serif font using a user accessible affordance (not hidden) setting.

  5. Скопируйте медиафайлы CTS на тестируемое устройство:

    1. Navigate ( cd ) to the path where the media files are downloaded and unzipped.
    2. Измените права доступа к файлу:

      chmod u+x copy_media.sh
      
    3. Скопируйте файлы:

      • To copy clips up to a resolution of 720x480, run:

        ./copy_media.sh 720x480
      • If you aren't sure of the maximum resolution, copy all of the files:

        ./copy_media.sh all
      • If there are multiple DUTs, add the serial option ( -s ) of a specific device to the end. For example, to copy up to 720x480 to the device with serial 1234567, run:

        ./copy_media.sh 720x480 -s 1234567

Загрузите файлы CTS, относящиеся к основной ветке.

Чтобы загрузить файлы CTS, относящиеся к основной ветке:

  1. Get the Android API level on the device by running:

    adb shell getprop ro.build.version.sdk
    
  2. Follow the instructions in the download_mcts.sh script to download the Mainline CTS files.

    The download takes at least 10 minutes, depending on your network speed.

Пакеты прокладок

The following table lists the packages available for each device version and architecture:

Версия устройства Пакеты (если поддерживается APEX) Пакеты (если APEX не поддерживается)
РУКА x86 РУКА x86
Android 17 17-arm-release android17-x86-release android17-arm-CtsShim.apk

android17-arm-CtsShimPriv.apk

android17-x86-CtsShim.apk

android17-x86-CtsShimPriv.apk

Android 16 QPR2 16-arm-release android16-x86-release android16-arm-CtsShim.apk

android16-arm-CtsShimPriv.apk

android16-x86-CtsShim.apk

android16-x86-CtsShimPriv.apk

Android 16 16-arm-release android16-x86-release android16-arm-CtsShim.apk

android16-arm-CtsShimPriv.apk

android16-x86-CtsShim.apk

android16-x86-CtsShimPriv.apk

Android 15 15-arm-release android15-x86-release android15-arm-CtsShim.apk

android15-arm-CtsShimPriv.apk

android15-x86-CtsShim.apk

android15-x86-CtsShimPriv.apk

Android 14 android14-arm-release android14-x86-release android14-arm-CtsShim.apk

android14-arm-CtsShimPriv.apk

android14-x86-CtsShim.apk

android14-x86-CtsShimPriv.apk

Android 13 android13-arm-release android13-x86-release android13-arm-CtsShim.apk

android13-arm-CtsShimPriv.apk

android13-x86-CtsShim.apk

android13-x86-CtsShimPriv.apk

Android 12 android12-arm-release android12-x86-release android12-arm-CtsShim.apk

android12-arm-CtsShimPriv.apk

android12-x86-CtsShim.apk

android12-x86-CtsShimPriv.apk

Android 11 android11-arm-release android11-x86-release android11-arm-CtsShim.apk

android11-arm-CtsShimPriv.apk

android11-x86-CtsShim.apk

android11-x86-CtsShimPriv.apk

Android 10 android10-release android10-arm-CtsShim.apk

android10-arm-CtsShimPriv.apk

android10-x86-CtsShim.apk

android10-x86-CtsShimPriv.apk

Android 9, O и O-MR1 Н/Д Н/Д arm-CtsShim.apk

arm-CtsShimPriv.apk

x86-CtsShim.apk

x86-CtsShimPriv.apk

Что дальше?

After reading this document, continue to Run automated CTS tests .