Pages

Label

Jumat, 20 Januari 2017

Android CTS test download and run on Device/Emulator

Hello GUYS !!! Hope Doing Well

Today I am going to discuss Android CTS test for framework level changes.


So Start with What is CTS?
 CTS is automated test suite to verify all the thing is working properly. If you made any changes in framework/middleware or driver level, Then You have to run CTS to verify that every thing is working properly.

I am here discussing step by step procedure to download and run CTS test cases in android Emulator or connected devices.

Compatibility Test Suite
How to download and run CTS test on device or emulator.

Step -1 Compatibility Test Suite Downloads
you can downloads CTS from following links based on your project requirement.
https://source.android.com/compatibility/cts/downloads.html
Then Unzip it on your /u/ Dir . It will create “android-cts” dir.

Step -2 Setting up CTS
CTS currently supports 64-bit Linux and Mac OS host machines. ADB and AAPT
Before running the CTS, make sure you have recent versions of both 
  • Android Debug Bridge (adb) and 
  • Asset Packaging Tool (AAPT) installed
You can run CTS on Emulator, CTS run from downloaded AOSP source code, and those tools' location added to the system path of your machine.
Ensure adb and aapt are in your system path.
Example:
PATH=$PATH:/home/myuser/android-sdk-linux_x86/platform-tools.
For more detail you can follow following link
https://source.android.com/compatibility/cts/setup.html

Step -3 Running CTS tests

1. Make sure you have at least one device connected
you check this by using adb command in your terminal :-
adb devices

2. Launch the cts-tradefed console by running the 'cts-tradefed'. If you've
downloaded and extracted the CTS zip, the script can be found at
android-cts/tools/cts-tradefed

Or else if you are working from the Android source tree and have run make cts,
the script can be found at
out/host/linux-x86/cts/android-cts/tools/cts-tradefed

3. Type following command in CTS-tradefed console to run CTS
'run cts' to run the default CTS plan

4. Some other useful commands are
To run a test module:
'run cts --module <module_name>'

To run a specific test:
'run cts --test <test_name>'

To shard a plan test run on multiple devices
'run cts --shards <number of shards>

note: all connected devices must be running the same build
For more options:
'run cts –help'
For more detail you can check this link:-
https://source.android.com/compatibility/cts/run.html

Step- 4 Run CTS test from development environment
Perform these steps to build and run cts-tradefed from the development environment:
cd <path to android source root>
make cts
cts-tradefed

Using CTS Verifier(supplement to the CTS)
CTS Verifier provides tests for those APIs and functions that cannot be tested on a stationary device without manual input, like audio quality, touchscreen, accelerometer, camera, etc.
The Setup and running process is simple compare to CTS.
For more detail you can follow this link
https://source.android.com/compatibility/cts/verifier.html

Thanks
Saurabh
Happy Coding !!!

0 komentar:

Posting Komentar

 
[tutup]