Home | History | Annotate | Download | only in cts
      1 page.title=Setting up CTS
      2 @jd:body
      3 
      4 <!--
      5     Copyright 2015 The Android Open Source Project
      6 
      7     Licensed under the Apache License, Version 2.0 (the "License");
      8     you may not use this file except in compliance with the License.
      9     You may obtain a copy of the License at
     10 
     11         http://www.apache.org/licenses/LICENSE-2.0
     12 
     13     Unless required by applicable law or agreed to in writing, software
     14     distributed under the License is distributed on an "AS IS" BASIS,
     15     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16     See the License for the specific language governing permissions and
     17     limitations under the License.
     18 -->
     19 <div id="qv-wrapper">
     20   <div id="qv">
     21     <h2>In this document</h2>
     22     <ol id="auto-toc">
     23     </ol>
     24   </div>
     25 </div>
     26 
     27 <h2 id=physical_environment>Physical environment</h2>
     28 <h3 id=wifi>Wi-Fi and IPv6</h3>
     29 <p>CTS tests require a Wi-Fi network that supports IPv6, can treat the Device
     30 Under Test (DUT) as an isolated client, and has an internet
     31 connection. An isolated client refers to a
     32 configuration where the DUT does not have visibility to the
     33 broadcast/multinetwork messages on that subnetwork, either by a Wi-Fi AP
     34 configuration or by running the DUT on an isolated sub-network without
     35 other devices being connected.</p>
     36 
     37 <p>If you don't have access to a native IPv6 network, an IPv6 carrier network,
     38 or a VPN to pass some tests depending on IPv6, you may instead use a Wi-Fi
     39 access point and an IPv6 tunnel. See Wikipedia <a
     40 href="http://en.wikipedia.org/wiki/List_of_IPv6_tunnel_brokers">list of IPv6
     41 tunnel brokers</a>.</p>
     42 
     43 <h3 id=ble_beacons>Bluetooth LE beacons</h3>
     44 <p>If the DUT supports the Bluetooth LE feature, then at least three
     45 Bluetooth LE beacons should be placed within five meters of the DUT for Bluetooth
     46 LE scan testing. Those beacons can be any kind, do not need to be
     47 configured or emit anything specific, and can include iBeacon,
     48 Eddystone, or even devices simulating BLE beacons.</p>
     49 
     50 <h2 id=desktop_setup>Desktop machine setup</h2>
     51 <p>CTS currently supports 64-bit Linux and Mac OS host machines.</p>
     52 
     53 <h3 id=adb>ADB and AAPT</h3>
     54 <p>Before running the CTS, make sure you have recent versions of both <a
     55 href="http://developer.android.com/tools/help/adb.html">Android Debug
     56 Bridge (adb)</a> and <a
     57 href="http://developer.android.com/guide/topics/manifest/uses-feature-element.html#testing">Android
     58 Asset Packaging Tool (AAPT)</a> installed and those tools' location added
     59 to the system path of your machine.</p>
     60 
     61 <p>To install ADB, download the <a
     62 href="http://developer.android.com/sdk/index.html#Other">Android SDK Tools</a>
     63 package for your operating system, open it, and follow the instructions in the
     64 included README file. For troubleshooting information, see <a
     65 href="http://developer.android.com/sdk/installing/index.html?pkg=tools">Installing
     66 the Stand-alone SDK Tools</a>.</p>
     67 
     68 <p>Ensure <code>adb</code> and <code>aapt</code> are in your system path. The
     69 following command assumes you've opened the package archive in your home
     70 directory:</p>
     71 <hr>
     72 <pre>
     73 export PATH=$PATH:$HOME/android-sdk-linux/platform-tools
     74 </pre>
     75 
     76 <p class="note"><strong>Note:</strong> Please ensure your starting path and
     77 directory name are correct.</p>
     78 
     79 <h3 id=JDK>Java Development Kit (JDK)</h3>
     80 <p>You need to install the proper version of the <a
     81 href="{@docRoot}source/initializing.html#installing-the-jdk">Java Development Kit (JDK)</a>:</p>
     82 
     83 <ul>
     84   <li>CTS 5.0 and later: Java 7
     85   <li>CTS 4.4 and earlier: Java 6
     86 </ul>
     87 
     88 <h3 id=CTS_files>CTS files</h3>
     89 
     90 <p><a href="{@docRoot}compatibility/downloads.html">Download</a> and open the CTS
     91 packages matching your devices' Android version and all the Application Binary
     92 Interfaces (ABIs) your devices support.</p>
     93 
     94 <p>Download and open the latest version of the <a
     95 href="{@docRoot}compatibility/downloads.html#cts-media-files">CTS Media
     96 Files</a>.</p>
     97 
     98 <h3 id=system_detect>Device detection</h3>
     99 <p>Follow the step to <a
    100 href="http://developer.android.com/tools/device.html#setting-up">set up your
    101 system to detect your device</a>, such as creating a <code>udev</code> rules
    102 file for Ubuntu Linux.</p>
    103 
    104 <h2 id=device_setup>Android device setup</h2>
    105 
    106 <h3 id=user_builds>User builds</h3>
    107 
    108 <p>A compatible device is defined as a device with a user/release-key signed
    109 build, so your device should be running a system image based on the known to be
    110 compatible user build (Android 4.0 and later) from <a
    111 href="{@docRoot}source/build-numbers.html">Codenames, Tags, and Build
    112 Numbers</a>.<br>
    113 
    114 <p class="caution"><strong>Caution:</strong> When used to confirm Android
    115 compatibility of your final system image, CTS must be executed on devices with
    116 a user build.</p>
    117 
    118 <h3 id=storage_requirements>Storage requirements</h3>
    119 <p>The CTS media stress tests require video clips to be on external storage
    120 (<code>/sdcard</code>). Most of the clips are from <a
    121 href="https://peach.blender.org/">Big Buck Bunny</a> which is copyrighted by
    122 the Blender Foundation under the<a
    123 href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 license.</a></p>
    124 <p>The required space depends on the maximum video playback resolution supported
    125   by the device (See section 5 in the compatibility definition document for the
    126   platform version of the required resolutions.) Note that the video playback
    127   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>
    128 <p>Here are the storage requirements by maximum video playback resolution:</p>
    129 <ul>
    130   <li>480x360: 98MB
    131   <li>720x480: 193MB
    132   <li>1280x720: 606MB
    133   <li>1920x1080: 1863MB
    134 </ul>
    135 
    136 <h3 id=screen_storage>Screen and storage</h3>
    137 <ol>
    138 <li>Any device that does not have an embedded screen needs to be connected to a screen.</li>
    139 <li>If the device has a memory card slot, plug in an empty SD card. <em>Use an
    140 SD card that supports Ultra High Speed (UHS) Bus with SDHC or SDXC capacity or
    141 one with at least speed class 10 or higher to ensure it can pass the CTS.</em>
    142 <p class="warning"><strong>Warning:</strong> CTS may modify/erase data on the SD card plugged into the device.</p>
    143 </li>
    144 <li>If the device has SIM card slots, plug in an activated SIM card to each slot. If the device supports SMS, each SIM card should have its own number field populated.</li>
    145 </li>
    146 </ol>
    147 
    148 <h2 id=config_device>Android device configuration</h2>
    149 <ol>
    150   <li>Factory data reset the device: <strong>Settings > Backup &amp; reset > Factory data reset</strong>
    151     <p class="warning"><strong>Warning:</strong> This will erase all user data from the device.</em></p>
    152   <li>Set your devices language to English (<strong>United States</strong>) from: <strong>Settings > Language
    153     & input > Language</strong>
    154   <li>Turn on the location setting if there is a GPS or Wi-Fi / Cellular network
    155     feature on the device: <strong>Settings &gt; Location</strong>
    156   <li>Connect to a Wi-Fi network  that supports IPv6, can treat the Device
    157 Under Test (DUT) as an <em>isolated client</em> (see the <a
    158 href="#physical_environment">Physical Environment</a> section above), and has an
    159 internet connection: <strong>Settings > Wi-Fi</strong>
    160   <li>Make sure no lock pattern or password is set on the device: <strong>Settings > Security > Screen
    161     lock = 'None'</strong>
    162   <li>Enable <strong>USB debugging</strong> on your device: <strong>Settings &gt; Developer options &gt; USB debugging</strong>.
    163        <p class="note"><strong>Note:</strong> On Android 4.2 and later, <strong>Developer
    164         options</strong> is hidden by default. To make them available, go
    165         to <strong>Settings &gt; About phone</strong> and tap <strong>Build number</strong>
    166         seven times. Return to the previous screen to find <strong>Developer
    167         options</strong>. See <a
    168         href="http://developer.android.com/tools/device.html#developer-device-options">Enabling
    169         On-device Developer Options</a> for additional details.</p>
    170   <li>Select: <strong>Settings > Developer options > Stay Awake</strong>
    171   <li>Select: <strong>Settings > Developer options > Allow mock locations</strong>
    172 <p class="note"><strong>Note:</strong> Starting in Android 6.0, this mock
    173 locations step is neither available nor required.</p>
    174   <li>Launch the browser and dismiss any startup/setup screen.
    175   <li>Connect the desktop machine that will be used to test the device with a USB cable
    176     <p class="note"><strong>Note:</strong> When you connect a device running Android 4.2.2 or later
    177     to your computer, the system shows a dialog asking whether to accept an RSA key that allows
    178     debugging through this computer. Select <em>Allow USB debugging</em>.</p>
    179   <li> Install and configure helper apps on the device.
    180 <p class="note"><strong>Note:</strong> For CTS versions 2.1 R2 through 4.2 R4</em>, set up your device (or emulator)
    181 to run the accessibility tests with:<br>
    182 <code>adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk</code><br>
    183 On the device, enable: <strong>Settings > Accessibility > Accessibility >
    184 Delegating Accessibility Service</strong></p>
    185 <p class="note"><strong>Note:</strong> For CTS 2.3 R4 and beyond on devices that declare the
    186 <code>android.software.device_admin feature</code>, set up your device to run
    187 the device administration tests with:<br>
    188 <code>adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk</code><br>
    189 On the device, enable only the two
    190 <code>android.deviceadmin.cts.CtsDeviceAdminReceiver*</code> device
    191 administrators under: <strong>Settings > Security > Select device
    192 administrators</strong>. Make sure the
    193 <code>android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver</code> and any
    194 other preloaded device administrators stay disabled in the same menu.</p>
    195 <li>Copy the CTS media files to the device as follows:
    196 <p class="note"><strong>Note:</strong> For CTS 2.3 R12 and beyond, if the
    197 device supports video codecs, the CTS media files must be copied to the
    198 device.</p>
    199 <ul>
    200   <li>Navigate (cd) to the path the media files are downloaded and unzipped to.
    201   <li>Change the file permissions: <code>chmod u+x copy_media.sh</code>
    202   <li>Run <code>copy_media.sh</code>:
    203     <ul>
    204       <li>To copy clips up to a resolution of 720x480, run: <code>./copy_media.sh 720x480</code>
    205       <li>If you are not sure about the maximum resolution, try <code>./copy_media.sh all</code> so that all files are copied.
    206       <li>If there are multiple devices under adb, add the -s (serial) option to the end.
    207         For example, to copy up to 720x480 to the device with serial 1234567, run: <code>./copy_media.sh 720x480 -s 1234567</code>
    208     </ul>
    209 </ul>
    210 </ol>
    211