TA的每日心情 | 无聊 2024-7-12 13:16 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
本帖最后由 乐哈哈yoyo 于 2019-4-3 15:17 编辑
一、简介
1. CTSc介绍
CTS:Android的CTS测试,英文为Compatibility Test Suite,意为兼容性测试。只有通过CTS测试的设备才有可能获得Android的商标和享受Android Market的权限;Android的CTS目的与意义:用户在android系统中有更好的用户体验,并且展示android应用的优越性,使得android开发者更容易编写高质量的andorid程序。
2. GTS介绍
GMS全称为Google MobileService,即谷歌移动服务。GMS是Google开发并推动Android的动力,也是Android系统的灵魂所在。GTS主要是对安卓手机上的GMS应用相关性能测试。
3. CTS Verifier 介绍
CTS verifier保证应用程序的可靠运行和用户有一个很好的体验,相对CTS和GTS 最大的不同是verifier 不能自动化测试,只能手工测试。
二、 测试流程-CTS环境的搭建
1. PC:ubuntu 14.04以上系统
最低要求安装ubuntu 14.04以上系统,目前在用的Ubuntu 16.04、 Ubuntu 14.04系统,保证系统和电脑都可以正常使用。
2. CTS 环境
android 8.0的CTS 环境为
CTS_8.0_r5(4500653)
GTS _5.1_r2(4507047)
Verifier 8.0_r54(0)
下载地址:
http://source.android.com/compatibility/downloads.html
将以上文件下载并拷贝到Ubuntu 系统home的CTS文件夹中并解压即可,并给可执行权限,具体下载页面见下图:
3. 环境搭建
N的环境需要SDK为26以上,下载地址:http://www.android-studio.org/
JDK要求在1.8以上,下载地址:https://www.oracle.com/index.html
环境配置方法:
1. sudo gedit /etc/profile
在里面添加如下配置:
///SDK配置
#set path for androidsdk tools
export PATH=$PATH:/your_android-sdk-linux_path/tools
exportPATH=$PATH:/your_android-sdk-linux_path/platform-tools
exportPATH=$PATH:/your_android-sdk-linux_path/ build-tools /26.0.0
环境配置好后输入 java –version 得到
java version"1.8.0_131"
Java(TM) SE RuntimeEnvironment (build 1.8.0_131-b11)
Java HotSpot(TM)64-Bit Server VM (build 25.131-b11, mixed mode)
输入aapt version得到
Android AssetPackaging Tool, v0.2-4062713
得到上面的结果,CTS的测试环境就配置好了,CTS就可以正常执行了。
JDK和SDK也有其他配置方法,可以自行学习试验。
三、测试流程-CTS 测试
1. 测试前的准备工作
1.Factory data reset thedevice: Settings > Backup & reset > Factory data reset,sony mobile不需要做此设置,只要在刷机时选择删除 usrdate
Warning: Thiswill erase all user data from the device.
2.Set your device's language toEnglish (United States) from: Settings > Language & input> Language
3.Turn on the location setting ifthere is a GPS or Wi-Fi / Cellular network feature on the device: Settings> Location > On
4.Connect to a Wi-Fi network thatsupports IPv6, can treat the Device Under Test (DUT) as an isolatedclient (see the Physical Environment sectionabove), and has an internet connection: Settings > Wi-Fi
5.Make sure no lock pattern orpassword is set on the device: Settings > Security > Screen lock> None
6.Enable USB debugging onyour device: Settings > Developer options > USB debugging.
Note: OnAndroid 4.2 and later, Developer options is hidden by default.To make them available, go to Settings > About phone andtap Build number seven times. Return to the previous screen tofind Developer options. See EnablingOn-device Developer Options for additional details.
7.Make sure the time is set to12-hour format: Settings > Date & time > Use 24-hour format> Off
8.Select: Settings >Developer options > Stay Awake > On
9.Select: Settings >Developer options > Allow mock locations > On
Note: Thismock locations setting is applicable only in Android 5.x and 4.4.x.
10.Select: Settings >Developer options > Verify apps over USB > Off
Note: Thisverify apps step became required in Android 4.2.
11.Launch the browser and dismissany startup/setup screen.
12.Connect the desktop machinethat will be used to test the device with a USB cable
Note: Whenyou connect a device running Android 4.2.2 or later to your computer, thesystem shows a dialog asking whether to accept an RSA key that allows debuggingthrough this computer. Select Allow USB debugging.
13.Install and configure helperapps on the device.
Note: For CTSversions 2.1 R2 through 4.2 R4, set up your device (or emulator) to run theaccessibility tests with:
adbinstall -randroid-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
On the device, enable: Settings > Accessibility > Accessibility> Delegating Accessibility Service
Note: For CTSversions prior to 7.0, on devices that declare android.software.device_admin, set up yourdevice to run the device administration test using:
adbinstall -r android-cts/repository/testcases/CtsDeviceAdmin.apk
In Settings > Security > Select device administrators,enable the twoandroid.deviceadmin.cts.CtsDeviceAdminReceiver* device administrators. Ensure theandroid.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver and any other preloaded device administrators remaindisabled.
14.Copy the CTS media files to thedevice as follows:
Note: For CTS2.3 R12 and later, if the device supports video codecs, the CTS media filesmust be copied to the device.
· Navigate (cd) to the path themedia files are downloaded and unzipped to.
· Change the file permissions: chmod u+xcopy_media.sh
· Run copy_media.sh:
· To copy clips up to aresolution of 720x480, run: ./copy_media.sh 720x480
· If you are not sure about themaximum resolution, try ./copy_media.sh all sothat all files are copied.
· If there are multiple devicesunder adb, add the -s (serial) option to the end. For example, to copy up to720x480 to the device with serial 1234567, run: ./copy_media.sh720x480 -s 1234567
15. If the DUT supports the Bluetooth LEfeature, then at least three Bluetooth LE beacons should be placed within fivemeters of the DUT for Bluetooth LE scan testing.
四、 工作总结
1. CTS 测试尽量在晚上执行,因为耗时比较长,避免耽误白天的时间;在测试前务必确认清楚电池的电量、USB的连接等。
2. GTS 和verifier尽量在白天执行,特别测试GTS 的时候,一定要在网络状况比较好的情况下测试,避免因网络问题导致测试fail,需要多次测试。
3. Result中的测试结果尽量及时清理,避免报告太多影响CTS 测试。
4. 电脑在长时间测试CTS 后,尽量的规律性的重启下电脑,避免因PC性能影响CTS测试。 |
|