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