Camrea测试-- CTS测试
碼字不易,多謝支持
1、名詞解釋
?????? CTS,Compatibility Test Suite 兼容性測試。谷歌CTS測試
2、環境準備
?? 1.安裝adb,配置環境變量
???????? 網上下載adb,并放在usr/local/目錄下
?? 2.將aapt放在和adb同級目錄
???????? java 使用aapt工具解析apk信息必備工具
???????? sudo? apt-get install aapt
???????? 配置aapt生效文檔 sudo gedit /etc/profile,添加export PATH=$PATH:/usr/local/aapt。
?? ????? 把代碼/out下aapt放到/usr/local/下,sudo?chmod +x?aapt
??? 3.安裝jdk1.9+,配置環境變量
????????? sudo apt install openjdk-9-jdk
??? 4.下載cts工具包,解壓即可。
????????? 安卓官網下載
??? 5、在手機設置中不鎖屏,并保證測試環境中有日光燈
3、測試步驟
??????? 1、手機連接電腦,adb devices 要顯示出設備??
×××@ubuntu:/Code/×××$ adb devices
List of devices attached
?????????????? ?no permissions
×××@ubuntu:/Code/×××$ adb kill-server
×××@ubuntu:/Code/×××$ sudo adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
×××@ubuntu:/Code/×××$ adb devices
List of devices attached
017×××ec0401?? ?device
??? 2、進入測試環境
×××@ubuntu:~/android-cts/tools$ ./cts-tradefed
==================
Notice:
We collect anonymous usage statistics in accordance with our Content Licenses (https://source.android.com/setup/start/licenses), Contributor License Agreement (https://opensource.google.com/docs/cla/), Privacy Policy (https://policies.google.com/privacy) and Terms of Service (https://policies.google.com/terms).
==================
Android Compatibility Test Suite 11_r1 (6654162)
Use "help" or "help all" to get more information on running commands.
08-31 18:05:37 I/DeviceManager: Detected new device 017×××ec0401
cts-tf >
3、單跑module
?? run cts -m CtsCameraTestCases
全測是在android-cts/testcases/CtsCameraTestCases。
? ? ?單跑某個case
run cts –m CtsAccelerationTestCases? -t android.camera.cts android.hardware.camera2.cts.NativeCameraDeviceTest#testCameraDevicePreviewWithSessionParameters[0]
? 兩個手機同跑某個case
? run cts -m CtsCameraTestCases –shards 2
4、繼續測全測的失敗項
run?retry?-s? [serial] --retey?sessionId?重新運行之前任務中的失敗用例,這個?sessionid?是執行?l?r?顯示出來的,第一列的數字。serial
??? l r??? //列出歷史測試的結果
???
? ? cts-tf > l r
??? Session Pass Fail Modules Complete? ?Result Directory? ? ? ? ? ?Test Plan? ? ? ? ?Device serial(s)? ? ? ? ? ? ?? Build ID? ? ? ? ? ? ? ? ? ? ? Product
???? ??? ??? ??? ??? 0? ? ? ? ? ?0? ? ? ? ?0? ? ? 0 of 3? ? ? ? ? ? ? ? ? ?2020.08.18_14.00.30? ? ?cts? ? ? ? ? ? ? ? ? [0123456789ABCDEF]? ? ? ?RP1A.200621.001? ? ? ?merlin
???? ??? ??? ??? ??? 1? ? ? ? ? ? 0? ? ? ? ?0? ? ? 0 of 3? ? ? ? ? ? ? ? ? ?2020.08.18_14.03.59? ? ? cts? ? ? ? ? ? ? ? ? ?[0123456789ABCDEF]? ? ? RP1A.200621.001? ? ? ? merlin
???? ??? ??? ??? ??? 2? ? ? ? ? ?0? ? ? ? ?0? ? ? 0 of 3? ? ? ? ? ? ? ? ? ?2020.08.18_14.09.20? ? ? cts? ? ? ? ? ? ? ? ? ?[0123456789ABCDEF]? ? ? ?RP1A.200621.001? ? ? ? merlin
???? ??? ??? ??? ??? 3? ? ? ? ? 1307? ? 400? 0 of 3? ? ? ? ? ? ? ? ? ?2020.08.18_14.15.00? ? ? ?cts? ? ? ? ? ? ? ? ? ?[0123456789ABCDEF]? ? ? RP1A.200621.001? ? ? ? ? merlin
???? ??? ??? ??? ??? 4? ? ? ? ?1033? ? ?674? ?0 of 3? ? ? ? ? ? ? ? ? 2020.08.20_14.06.50? ? ?cts? ? ? ? ? ? ? ? ? ?[016×××610401]? ? ? ? ? ? ? ? ?RP1A.200621.001? ? ? ? ? merlin
? ? run?retry? --retry 4 ????? ? ?//4是session
輸入help,查看命令行,help + command==>查看具體的命令的介紹
Tips:CTS卡住的時候,表現出的形式是測試框黑屏&不動
? ? ? ? ??切換出去測試界面,切換到camera,然后再切換回到測試界面。就可以跳過某一項測試
4、view失敗項
?????? CTS測試完之后會有result,具體的目錄android-cts/results/2020.08.27_17.44.10/test_result.html
?????? 這里面就會介紹CTS測試的具體失敗問題,和錯誤的原因。這時候就要具體分析,解bug。大概分析出是平臺問題或者排除了驅動的問題,就可以MTK或者高通官網上提case
?
5、環境配置中可能會遇到的問題
? ? ? 問題1:aapt 不好使 &&?sudo apt-get update 更新失敗
? ? ?環境:ubuntu19.04 + openjdk-11 + adb + aapt2.5
? ? ?問題:終端界面輸入>aapt? ? ? ? ? //提示沒有安裝
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?>sudo apt-get update? //提示 sub 類報錯
? ? ?原因:排查到ubuntu 鏡像源文件(/etc/apt/sources.list)中有兩個鏡像源
? ? ?解決方法:干掉不好使的阿里云鏡像,保留好使的中科大鏡像。以上問題得以解決
?
?
總結
以上是生活随笔為你收集整理的Camrea测试-- CTS测试的全部內容,希望文章能夠幫你解決所遇到的問題。