blob: 6e13edef98aefdbe9875c2b975509d161f795d8c [file] [log] [blame]
Clay Murphy468ba572015-04-13 18:25:11 -07001page.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=desktop_setup>Desktop machine setup</h2>
Clay Murphyc3dea072015-09-29 15:04:30 -070028<h3 id=adb>ADB and AAPT</h3>
29<p>Before running the CTS, make sure you have recent versions of both <a
30href="http://developer.android.com/tools/help/adb.html">Android Debug
31Bridge (adb)</a> and <a
32href="http://developer.android.com/guide/topics/manifest/uses-feature-element.html#testing">Android
33Asset Packaging Tool (AAPT)</a> installed and those tools' location added
34to the system path of your machine.</p>
Clay Murphy468ba572015-04-13 18:25:11 -070035
36<p>To install ADB, download the <a
37href="http://developer.android.com/sdk/index.html#Other">Android SDK Tools</a>
38package for your operating system, open it, and follow the instructions in the
39included README file. For troubleshooting information, see <a
40href="http://developer.android.com/sdk/installing/index.html?pkg=tools">Installing
41the Stand-alone SDK Tools</a>.</p>
42
Clay Murphyc3dea072015-09-29 15:04:30 -070043<p>Ensure <code>adb</code> and <code>aapt</code> are in your system path. The
44following command assumes you've opened the package archive in your home
45directory:</p>
Clay Murphy468ba572015-04-13 18:25:11 -070046<hr>
47<pre>
48export PATH=$PATH:$HOME/android-sdk-linux/platform-tools
49</pre>
50
51<p class="note"><strong>Note:</strong> Please ensure your starting path and
52directory name are correct.</p>
53
54<h3 id=JDK>Java Development Kit (JDK)</h3>
55<p>You need to install the proper version of the <a
56href="{@docRoot}source/initializing.html#installing-the-jdk">Java Development Kit (JDK)</a>:</p>
57
58<ul>
59 <li>CTS 5.0 and later: Java 7
60 <li>CTS 4.4 and earlier: Java 6
61</ul>
62
63<h3 id=CTS_files>CTS files</h3>
64
65<p><a href="{@docRoot}compatibility/downloads.html">Download</a> and open the CTS
66packages matching your devices' Android version and all the Application Binary
67Interfaces (ABIs) your devices support.</p>
68
69<p>Download and open the latest version of the <a
70href="{@docRoot}compatibility/downloads.html#cts-media-files">CTS Media
71Files</a>.</p>
72
73<h3 id=system_detect>Device detection</h3>
74<p>Follow the step to <a
75href="http://developer.android.com/tools/device.html#setting-up">set up your
76system to detect your device</a>, such as creating a <code>udev</code> rules
77file for Ubuntu Linux.</p>
78
79<h2 id=device_setup>Android device setup</h2>
80
81<h3 id=user_builds>User builds</h3>
Clay Murphyc3dea072015-09-29 15:04:30 -070082
83<p>A compatible device is defined as a device with a user/release-key signed
84build, so your device should be running a system image based on the known to be
85compatible user build (Android 4.0 and later) from <a
Clay Murphy468ba572015-04-13 18:25:11 -070086href="{@docRoot}source/build-numbers.html">Codenames, Tags, and Build
Clay Murphyc3dea072015-09-29 15:04:30 -070087Numbers</a>.<br>
88
89<p class="caution"><strong>Caution:</strong> When used to confirm Android
90compatibility of your final system image, CTS must be executed on devices with
91a user build.</p>
Clay Murphy468ba572015-04-13 18:25:11 -070092
93<h3 id=storage_requirements>Storage requirements</h3>
94<p>The CTS media stress tests require video clips to be on external storage
95(<code>/sdcard</code>). Most of the clips are from <a
96href="https://peach.blender.org/">Big Buck Bunny</a> which is copyrighted by
97the Blender Foundation under the <a
98href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 license.</a></p>
99<p>The required space depends on the maximum video playback resolution supported
100 by the device (See section 5 in the compatibility definition document for the
101 platform version of the required resolutions.) Note that the video playback
102 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>
103<p>Here are the storage requirements by maximum video playback resolution:</p>
104<ul>
105 <li>480x360: 98MB
106 <li>720x480: 193MB
107 <li>1280x720: 606MB
108 <li>1920x1080: 1863MB
109</ul>
110
111<h3 id=screen_storage>Screen and storage</h3>
112<ol>
113<li>Any device that does not have an embedded screen needs to be connected to a screen.</li>
114<li>If the device has a memory card slot, plug in an empty SD card. <em>Use an
115SD card that supports Ultra High Speed (UHS) Bus with SDHC or SDXC capacity or
116one with at least speed class 10 or higher to ensure it can pass the CTS.</em>
117<p class="warning"><strong>Warning:</strong> CTS may modify/erase data on the SD card plugged into the device.</p>
118</li>
Clay Murphyc3dea072015-09-29 15:04:30 -0700119<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>
Clay Murphy468ba572015-04-13 18:25:11 -0700120</li>
121</ol>
122
123<h2 id=config_device>Android device configuration</h2>
124<ol>
125 <li>Factory data reset the device: <strong>Settings > Backup &amp; reset > Factory data reset</strong>
126 <p class="warning"><strong>Warning:</strong> This will erase all user data from the device.</em></p>
127 <li>Set your device’s language to English (<strong>United States</strong>) from: <strong>Settings > Language
128 & input > Language</strong>
129 <li>Turn on the location setting if there is a GPS or Wi-Fi / Cellular network
130 feature on the device: <strong>Settings &gt; Location</strong>
Clay Murphyc3dea072015-09-29 15:04:30 -0700131 <li>Connect to a Wi-Fi network that supports IPv6, can treat the Device
132Under Test (DUT) as an <em>isolated client</em> (see note below), and has an
133internet connection: <strong>Settings > Wi-Fi</strong>
134<p class="note"><strong>Tip:</strong> If you don’t have access to a native
135IPv6 network, an IPv6 carrier network,
136or a VPN to pass some tests depending on IPv6, you may instead use a
137Wi-Fi
Clay Murphy468ba572015-04-13 18:25:11 -0700138 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>
Clay Murphyc3dea072015-09-29 15:04:30 -0700139<p class="note"><strong>Note:</strong> An isolated client refers to a
140configuration where the DUT does not have visibility to the
141broadcast/multinetwork messages on that subnetwork, either by a Wi-Fi AP
142configuration or by running the DUT on an isolated sub-network without
143other devices being connected.</p>
Clay Murphy468ba572015-04-13 18:25:11 -0700144 <li>Make sure no lock pattern or password is set on the device: <strong>Settings > Security > Screen
145 lock = 'None'</strong>
146 <li>Enable <strong>USB debugging</strong> on your device: <strong>Settings &gt; Developer options &gt; USB debugging</strong>.
147 <p class="note"><strong>Note:</strong> On Android 4.2 and later, <strong>Developer
148 options</strong> is hidden by default. To make them available, go
149 to <strong>Settings &gt; About phone</strong> and tap <strong>Build number</strong>
150 seven times. Return to the previous screen to find <strong>Developer
151 options</strong>. See <a
152 href="http://developer.android.com/tools/device.html#developer-device-options">Enabling
153 On-device Developer Options</a> for additional details.</p>
154 <li>Select: <strong>Settings > Developer options > Stay Awake</strong>
155 <li>Select: <strong>Settings > Developer options > Allow mock locations</strong>
Clay Murphyc3dea072015-09-29 15:04:30 -0700156<p class="note"><strong>Note:</strong> Starting in Android 6.0, this mock
157locations step is neither available nor required.</p>
Clay Murphy468ba572015-04-13 18:25:11 -0700158 <li>Launch the browser and dismiss any startup/setup screen.
159 <li>Connect the desktop machine that will be used to test the device with a USB cable
160 <p class="note"><strong>Note:</strong> When you connect a device running Android 4.2.2 or later
161 to your computer, the system shows a dialog asking whether to accept an RSA key that allows
162 debugging through this computer. Select <em>Allow USB debugging</em>.</p>
163 <li> Install and configure helper apps on the device.
164<p class="note"><strong>Note:</strong> For CTS versions 2.1 R2 through 4.2 R4</em>, set up your device (or emulator)
165to run the accessibility tests with:<br>
166<code>adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk</code><br>
167On the device, enable: <strong>Settings > Accessibility > Accessibility >
168Delegating Accessibility Service</strong></p>
169<p class="note"><strong>Note:</strong> For CTS 2.3 R4 and beyond on devices that declare the
170<code>android.software.device_admin feature</code>, set up your device to run
171the device administration tests with:<br>
172<code>adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk</code><br>
173On the device, enable only the two
174<code>android.deviceadmin.cts.CtsDeviceAdminReceiver*</code> device
175administrators under: <strong>Settings > Security > Select device
176administrators</strong>. Make sure the
177<code>android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver</code> and any
178other preloaded device administrators stay disabled in the same menu.</p>
179<li>Copy the CTS media files to the device as follows:
180<p class="note"><strong>Note:</strong> For CTS 2.3 R12 and beyond, if the
181device supports video codecs, the CTS media files must be copied to the
182device.</p>
183<ul>
184 <li>Navigate (cd) to the path the media files are downloaded and unzipped to.
185 <li>Change the file permissions: <code>chmod u+x copy_media.sh</code>
186 <li>Run <code>copy_media.sh</code>:
187 <ul>
188 <li>To copy clips up to a resolution of 720x480, run: <code>./copy_media.sh 720x480</code>
189 <li>If you are not sure about the maximum resolution, try <code>./copy_media.sh all</code> so that all files are copied.
190 <li>If there are multiple devices under adb, add the -s (serial) option to the end.
191 For example, to copy up to 720x480 to the device with serial 1234567, run: <code>./copy_media.sh 720x480 -s 1234567</code>
192 </ul>
193</ul>
194</ol>