Android cts4.2 Windows Environment Setup instructions

Source: Internet
Author: User
Tags save file

Recently due to work needs, to our smart phone compatibility test, in the online about Windows test environment set up the introduction is more messy, here summarize my androidcts test under the Windows environment to build, share to everyone, hope for everyone useful.

Tools/Materials
    • Android sdk:android_sdk_windows

      Java Developer Kit: JDK

      Phone Driver: usb_driver

      Cts:android-cts-4.2_r4-linux_x86-arm.zip all apk used by the CTS test

      CTS Media:android-cts-media-1.0.zip Video Resources for multimedia stress testing with CTS

      CTS verifier Apk:android-cts-verifier-4.1_r6-linux_x86-arm.zip

Method/Step

First, the ADB configuration:

  1. 1. Install JDK and Java environment variables:

    1> Installing the JDK:

    Double-click Unzip CTS_JDK_SDK double-click Cts_jdk_sdk\jdk jdk-7u3-windows-i586.exe always enter the default installation path.

    2> Configuring Java Environment variables:

    Right click on "My Computer", click on "Properties"-"advanced"-"environment variable"--"system Variables", set 3 properties, Java_home,path,classpath (case does not matter), if already exist then click "Edit", do not exist then click "New";

    Java_home indicates the JDK installation path, which is the path C:\Program files\java\jdk1.7.0_03 that was selected at the time of installation, which includes folders such as LIB,BIN,JRE (this variable is best set because Tomcat is run later, Eclipse and so on need to be dependent on this variable);

    Path allows the system to identify Java commands under any path, set to:

    %java_home%/bin;%java_home%/jre/bin

    Classpath is the Java load class or lib path, only the class is in Classpath, the Java command is recognized, set to:

    .; %java_home%/lib/dt.jar;%java_home%/lib/tools.jar;%sdk_root%/tools;%java_home% is referring to the JAVA_HOME specified earlier;

    6. "Start"->; " Run, type "cmd";

    7. Type the command "Java-version", "Java", "Javac" a few commands, the following screen shows that the environment variable configuration is successful;

    Java version "1.7.0_45" Java (tm) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot (tm) Client VM (build 24.45-b08, MI Xed mode, sharing)

  2. ADB configuration:

    Copy the Adb.exe and AdbWinApi.dll under the Tools directory in the Android SDK package to the System32 directory under Windows.

    Connect your phone and enter the ADB shell to log in to your phone.

Second, the CTS environment configuration:

  1. Copy the Android_sdk_windows and CTS from the CTS_JDK_SDK package to the D or C drive. Here I copy to the D-disk directory for example:

    1> Configuring the SDK variable directory:

    Right click "My Computer", click "Properties"-"advanced"-"environment variable"--"System variable" add Sdk_root variable: variable name: Sdk_root Variable Value: D:\android_sdk_windows

    (2). Turn on the debug mode of the phone, connect the computer and install the driver, use

    ADB install android-cts/repository/testcases/ctsdelegatingaccessibilityservice.apk

    You will then have one more delegating accessibility service option in Setting->accessibility, set this option to ON.

    ADB install android-cts/repository/testcases/ctsdeviceadmin.apk

    ADB install ctsverifier.apk

    Add three more options under Setting->security->device Administrators and select the three options to activate

    Empty the SD card. Create a new directory in the SD card test, unzip the android-cts-media-1.0.zip into the test directory, and insert the SD card into the phone. To determine the SD card as a readable writable state

    Another: In order to ensure the smooth testing, mobile phones do not use a pattern or password lock, other optional settings can be found in the CTS related documents (not required);

Three, mobile phone settings:

  1. Setting->security->screen Lock is set to None

    Setting->display->screen timeout--minutes

    Open the WiFi Connection network (if it is an automated test, the test will be networked to download some apk app for testing).

    Create the Cts.bat batch file file with the following contents:

    ECHO OFF

    ECHO CTS (Compatibility Test Suite) ...

    D:

    CD D:\androidCTS\CTS\android-cts\tools

    JAVA-CP ddmlib-prebuilt.jar;tradefed-prebuilt.jar;hosttestlib.jar;cts-tradefed.jar-dcts_root=d:\cts Com.android.cts.tradefed.command.CtsConsole

    Save file to Cts\android-cts\tools

Iv. CTS Testing:

  1. After the phone is powered on, use USB to connect to your phone and computer, double-click the cts.bat Batch command that runs Cts\android-cts\tools, and the command line appears with the following information:

    D:\cts\android-cts\tools>echo OFF

    CTS (Compatibility Test Suite) ...

    Android CTS 4.2_R4

    01-07 18:41:34 i/: detected new device 0123456789ABCDEF

    Enter the run CTS--plan CTS to begin automatic full testing:

    CTS-TF > Run CTS--plan CTS

    01-07 18:41:57 i/testinvocation:starting invocation for ' CTS ' on Build ' 4.2_R4 '

    On device 0123456789ABCDEF

    01-07 18:41:57 i/0123456789abcdef:created result dir 2014.01.07_18.41.57

    CTS-TF >

    .....

    This automatic test will run automatically and will restart the phone multiple times during the test, which is a normal test. The entire automated test time may be long, at least 3, 4 hours There are some module tests or a functional test, you can enter the cts_tf> after entering help to view the relevant module test commands.

    If you want to see those package inputs that can test the system: L packages will show all the packages that can be tested, such as:

    CTS-TF > L Packages

    Android.acceleration

    Android.accessibility

    Android.accessibilityservice

    Android.accounts

    Android.admin

    Android.animation

    Android.app

    Android.bluetooth

    Android.calendarcommon

    Android.content

    Android.core.tests.libcore.package.com

    Android.core.tests.libcore.package.dalvik

    Android.core.tests.libcore.package.libcore

    android.core.tests.libcore.package.org

    Android.core.tests.libcore.package.sun

    Android.core.tests.libcore.package.tests

    Android.core.vm-tests-tf

    Android.database

    android.dpi

    Android.dpi2

    Android.drm

    Android.effect

    Android.example

    Android.gesture

    Android.graphics

    Android.graphics2

    Android.hardware

    Android.holo

    Android.jni

    Android.location

    Android.media

    Android.mediastress

    Android.monkey

    Android.nativemedia.sl

    Android.nativemedia.xa

    Android.ndef

    Android.net

    Android.opengl

    Android.openglperf

    Android.os

    Android.permission

    Android.permission2

    Android.preference

    Android.preference2

    Android.provider

    Android.renderscript

    Android.sax

    Android.security

    Android.speech

    Android.telephony

    Android.tests.appsecurity

    Android.tests.sigtest

    Android.text

    Android.textureview

    Android.theme

    Android.uiautomator

    Android.util

    Android.view

    Android.webkit

    Android.widget

    Enter run Cts-p Android.view to start testing the phone's UI display

    You can use L p or L plan to see which test plans you can perform such as:

    CTS-TF > L P

    Android

    Appsecurity

    Cts-tf

    Cts

    Java

    PDK

    Signature

    Vm-tf

    As input run CTS--plan java to start Java test plan

    The above is the course that I have to pass the procedure will be because ANDROIDSDK and JDK storage location is different, please according to their actual path to make changes.

    At the same time thank many friends on the network to provide ideas, I here is their ideas or methods to integrate their own practice to make a summary. If you see this article, hope to help you, but also please correct the problems that may exist.


Android cts4.2 Windows Environment Setup instructions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.