page.title=Setting up CTS @jd:body
CTS tests require a Wi-Fi network that supports IPv6, can treat the Device Under Test (DUT) as an isolated client, and has an internet connection. An isolated client refers to a configuration where the DUT does not have visibility to the broadcast/multinetwork messages on that subnetwork, either by a Wi-Fi AP configuration or by running the DUT on an isolated sub-network without other devices being connected.
If you don't have access to a native IPv6 network, an IPv6 carrier network, or a VPN to pass some tests depending on IPv6, you may instead use a Wi-Fi access point and an IPv6 tunnel. See Wikipedia list of IPv6 tunnel brokers.
If the DUT supports the Bluetooth LE feature, then at least three Bluetooth LE beacons should be placed within five meters of the DUT for Bluetooth LE scan testing. Those beacons can be any kind, do not need to be configured or emit anything specific, and can include iBeacon, Eddystone, or even devices simulating BLE beacons.
CTS currently supports 64-bit Linux and Mac OS host machines.
Before running the CTS, make sure you have recent versions of both Android Debug Bridge (adb) and Android Asset Packaging Tool (AAPT) installed and those tools' location added to the system path of your machine.
To install ADB, download the Android SDK Tools package for your operating system, open it, and follow the instructions in the included README file. For troubleshooting information, see Installing the Stand-alone SDK Tools.
Ensure adb and aapt are in your system path. The
following command assumes you've opened the package archive in your home
directory:
export PATH=$PATH:$HOME/android-sdk-linux/platform-tools
Note: Please ensure your starting path and directory name are correct.
You need to install the proper version of the Java Development Kit (JDK):
Download and open the CTS packages matching your devices' Android version and all the Application Binary Interfaces (ABIs) your devices support.
Download and open the latest version of the CTS Media Files.
Follow the step to set up your
system to detect your device, such as creating a udev rules
file for Ubuntu Linux.
A compatible device is defined as a device with a user/release-key signed
build, so your device should be running a system image based on the known to be
compatible user build (Android 4.0 and later) from Codenames, Tags, and Build
Numbers.
Caution: When used to confirm Android compatibility of your final system image, CTS must be executed on devices with a user build.
The CTS media stress tests require video clips to be on external storage
(/sdcard). Most of the clips are from Big Buck Bunny which is copyrighted by
the Blender Foundation under the Creative Commons Attribution 3.0 license.
The required space depends on the maximum video playback resolution supported
by the device (See section 5 in the compatibility definition document for the
platform version of the required resolutions.) Note that the video playback
capabilities of the device under test will be checked via the android.media.CamcorderProfile APIs for earlier versions of Android and the android.media.MediaCodecInfo.CodecCapabilities APIs from Android 5.0.
Here are the storage requirements by maximum video playback resolution:
Warning: CTS may modify/erase data on the SD card plugged into the device.
Warning: This will erase all user data from the device.
Note: On Android 4.2 and later, Developer options is hidden by default. To make them available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options. See Enabling On-device Developer Options for additional details.
Note: Starting in Android 6.0, this mock locations step is neither available nor required.
Note: When you connect a device running Android 4.2.2 or later to your computer, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. Select Allow USB debugging.
Note: For CTS versions 2.1 R2 through 4.2 R4, set up your device (or emulator)
to run the accessibility tests with:
adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
On the device, enable: Settings > Accessibility > Accessibility >
Delegating Accessibility Service
Note: For CTS 2.3 R4 and beyond on devices that declare the
android.software.device_admin feature, set up your device to run
the device administration tests with:
adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk
On the device, enable only the two
android.deviceadmin.cts.CtsDeviceAdminReceiver* device
administrators under: Settings > Security > Select device
administrators. Make sure the
android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver and any
other preloaded device administrators stay disabled in the same menu.
Note: For CTS 2.3 R12 and beyond, if the device supports video codecs, the CTS media files must be copied to the device.
chmod u+x copy_media.sh
copy_media.sh:
./copy_media.sh 720x480
./copy_media.sh all so that all files are copied.
./copy_media.sh 720x480 -s 1234567