blob: dc9327872e417a59081a5f7d8c42ffb96a9ba813 [file] [log] [blame]
page.title=Setting up CTS
@jd:body
<!--
Copyright 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div id="qv-wrapper">
<div id="qv">
<h2>In this document</h2>
<ol id="auto-toc">
</ol>
</div>
</div>
<h2 id=desktop_setup>Desktop machine setup</h2>
<h3 id=adb>Android Debug Bridge (ADB)</h3>
<p>Before running the CTS, make sure you have a recent version of Android Debug
Bridge (adb) installed and the <code>adb</code> location added to the system
path of your machine.</p>
<p>To install ADB, download the <a
href="http://developer.android.com/sdk/index.html#Other">Android SDK Tools</a>
package for your operating system, open it, and follow the instructions in the
included README file. For troubleshooting information, see <a
href="http://developer.android.com/sdk/installing/index.html?pkg=tools">Installing
the Stand-alone SDK Tools</a>.</p>
<p>Ensure <code>adb</code> is in your system path. The following command
assumes you've opened the package archive in your home directory:</p>
<hr>
<pre>
export PATH=$PATH:$HOME/android-sdk-linux/platform-tools
</pre>
<p class="note"><strong>Note:</strong> Please ensure your starting path and
directory name are correct.</p>
<h3 id=JDK>Java Development Kit (JDK)</h3>
<p>You need to install the proper version of the <a
href="{@docRoot}source/initializing.html#installing-the-jdk">Java Development Kit (JDK)</a>:</p>
<ul>
<li>CTS 5.0 and later: Java 7
<li>CTS 4.4 and earlier: Java 6
</ul>
<h3 id=CTS_files>CTS files</h3>
<p><a href="{@docRoot}compatibility/downloads.html">Download</a> and open the CTS
packages matching your devices' Android version and all the Application Binary
Interfaces (ABIs) your devices support.</p>
<p>Download and open the latest version of the <a
href="{@docRoot}compatibility/downloads.html#cts-media-files">CTS Media
Files</a>.</p>
<h3 id=system_detect>Device detection</h3>
<p>Follow the step to <a
href="http://developer.android.com/tools/device.html#setting-up">set up your
system to detect your device</a>, such as creating a <code>udev</code> rules
file for Ubuntu Linux.</p>
<h2 id=device_setup>Android device setup</h2>
<h3 id=user_builds>User builds</h3>
<p>To prevent test timeouts and other failures, your device should be running a
<strong>user build (Android 4.0 and later)</strongfrom <a
href="{@docRoot}source/build-numbers.html">Codenames, Tags, and Build
Numbers</a> of source.android.com.<br>
<p class="note"><strong>Note:</strong> CTS should be executed on consumer
(user build) devices only.</p>
</ol>
<h3 id=storage_requirements>Storage requirements</h3>
<p>The CTS media stress tests require video clips to be on external storage
(<code>/sdcard</code>). Most of the clips are from <a
href="https://peach.blender.org/">Big Buck Bunny</a> which is copyrighted by
the Blender Foundation under the <a
href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 license.</a></p>
<p>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 <code>android.media.CamcorderProfile</code> APIs for earlier versions of Android and the <code>android.media.MediaCodecInfo.CodecCapabilities</code> APIs from Android 5.0.</p>
<p>Here are the storage requirements by maximum video playback resolution:</p>
<ul>
<li>480x360: 98MB
<li>720x480: 193MB
<li>1280x720: 606MB
<li>1920x1080: 1863MB
</ul>
<h3 id=screen_storage>Screen and storage</h3>
<ol>
<li>Any device that does not have an embedded screen needs to be connected to a screen.</li>
<li>If the device has a memory card slot, plug in an empty SD card. <em>Use an
SD card that supports Ultra High Speed (UHS) Bus with SDHC or SDXC capacity or
one with at least speed class 10 or higher to ensure it can pass the CTS.</em>
<p class="warning"><strong>Warning:</strong> CTS may modify/erase data on the SD card plugged into the device.</p>
</li>
<li>If the device has SIM card slots, plug in an activated SIM card to each slot.</li>
</li>
</ol>
<h2 id=config_device>Android device configuration</h2>
<ol>
<li>Factory data reset the device: <strong>Settings > Backup &amp; reset > Factory data reset</strong>
<p class="warning"><strong>Warning:</strong> This will erase all user data from the device.</em></p>
<li>Set your devices language to English (<strong>United States</strong>) from: <strong>Settings > Language
& input > Language</strong>
<li>Turn on the location setting if there is a GPS or Wi-Fi / Cellular network
feature on the device: <strong>Settings &gt; Location</strong>
<li>Connect to a Wi-Fi network that supports IPv6 and has an
internet connection: <strong>Settings > Wi-Fi</strong>
<p class="note"><strong>Note:</strong> If you dont 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 <a href="http://en.wikipedia.org/wiki/List_of_IPv6_tunnel_brokers">list of IPv6 tunnel brokers</a>.</p>
<li>Make sure no lock pattern or password is set on the device: <strong>Settings > Security > Screen
lock = 'None'</strong>
<li>Enable <strong>USB debugging</strong> on your device: <strong>Settings &gt; Developer options &gt; USB debugging</strong>.
<p class="note"><strong>Note:</strong> On Android 4.2 and later, <strong>Developer
options</strong> is hidden by default. To make them available, go
to <strong>Settings &gt; About phone</strong> and tap <strong>Build number</strong>
seven times. Return to the previous screen to find <strong>Developer
options</strong>. See <a
href="http://developer.android.com/tools/device.html#developer-device-options">Enabling
On-device Developer Options</a> for additional details.</p>
<li>Select: <strong>Settings > Developer options > Stay Awake</strong>
<li>Select: <strong>Settings > Developer options > Allow mock locations</strong>
<li>Launch the browser and dismiss any startup/setup screen.
<li>Connect the desktop machine that will be used to test the device with a USB cable
<p class="note"><strong>Note:</strong> 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 <em>Allow USB debugging</em>.</p>
<li> Install and configure helper apps on the device.
<p class="note"><strong>Note:</strong> For CTS versions 2.1 R2 through 4.2 R4</em>, set up your device (or emulator)
to run the accessibility tests with:<br>
<code>adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk</code><br>
On the device, enable: <strong>Settings > Accessibility > Accessibility >
Delegating Accessibility Service</strong></p>
<p class="note"><strong>Note:</strong> For CTS 2.3 R4 and beyond on devices that declare the
<code>android.software.device_admin feature</code>, set up your device to run
the device administration tests with:<br>
<code>adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk</code><br>
On the device, enable only the two
<code>android.deviceadmin.cts.CtsDeviceAdminReceiver*</code> device
administrators under: <strong>Settings > Security > Select device
administrators</strong>. Make sure the
<code>android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver</code> and any
other preloaded device administrators stay disabled in the same menu.</p>
<li>Copy the CTS media files to the device as follows:
<p class="note"><strong>Note:</strong> For CTS 2.3 R12 and beyond, if the
device supports video codecs, the CTS media files must be copied to the
device.</p>
<ul>
<li>Navigate (cd) to the path the media files are downloaded and unzipped to.
<li>Change the file permissions: <code>chmod u+x copy_media.sh</code>
<li>Run <code>copy_media.sh</code>:
<ul>
<li>To copy clips up to a resolution of 720x480, run: <code>./copy_media.sh 720x480</code>
<li>If you are not sure about the maximum resolution, try <code>./copy_media.sh all</code> so that all files are copied.
<li>If there are multiple devices under adb, add the -s (serial) option to the end.
For example, to copy up to 720x480 to the device with serial 1234567, run: <code>./copy_media.sh 720x480 -s 1234567</code>
</ul>
</ul>
</ol>