GMS笔记

2,594 阅读3分钟

CTS :

跑前要插电话卡和内存卡 

执行 :cd tools 执行 sudo ./cts-tradefed

 执行 :run cts-suite 

执行 :新命令 run cts-suite -- shard-count (手机数量)

       旧 命令 run cts --shard -count

CTS 第一遍结束之后,会有很多没有执行的项或者是模块,需要执行如下命令 继续未完成的 cts 测试

 先执行 l r 

模块:run cts --retry (id) --retry-type not_executed

项:run cts --retry id

 run retry --retry id

 run retry --retry (id) -s (手机SN号)


测试单个模块 run cts -m<模块>

 测试单个测试项 run cts -m <module> -t (test_name)

 跳过一个模块 run retry --retry (id) --exclude-filter (模块) -s (手机编号)

  测试64位或者32位

run cts -m <module> -t (test_name) -a armeabi-v7a//arm64-v8a

GTS:

执行 cd tools

 执行 sudo ./gts-tradefed 

执行 run gts-suite -s {手机编号}

 继续未完成的 gts 测试

先执行 l r  查看gts报告

,run retry --retry (id)  -s {手机编号}   


 测试单个模块 run gts -m <module> 

 测试单个测试项 run gts -m <module> -t test_name 

 跳过一个模块 run retry --retry (id) --exclude-filter (模块) -s (手机编号)

 跑缺失模块 run retry --retry (id) --retry-type NOT_EXECUTED 


GSI

刷机: 

1.fastboot devices  查看手机连接成功

2.找文件 

3.开机重启 进入fastboot模式   开机键+音量上键

4.执行:fastboot flashing unlock 、fastboot oem unlock 

 5.刷入谷歌 img文件

6.fastboot flash system + 文件 

(9.0项目要刷入 vbmeta.img文件后才能正常开机)

7. fastboot reboot

跑测:

 执行 sudo ./gts-tradefed 

 8.run cts-on-gsi --shards(id) 

 9?单跑某一个模块 > run vts -m <模块名> 

10?单跑某个测试项 > run vts -m <模块名> -t <测试项名>

 11 跑缺失项 run cts-on-gsi --retry id --retry-type NOT_EXECUTED


 VTS 跑不起来修改方法



02-25 10:28:35 I/ResultReporter: Invocation finished in 4s. PASSED: 0, FAILED: 0, MODULES: 0 of 148 02-25 10:28:35 E/CommandScheduler: com.android.tradefed.targetprep.TargetSetupError: Failed to create virtualenv java.lang.RuntimeException: com.android.tradefed.targetprep.TargetSetupError: Failed to create virtualenv at com.android.compatibility.common.tradefed.testtype.ModuleDef.runPreparerSetup(ModuleDef.java:354) at com.android.compatibility.common.tradefed.testtype.ModuleDef.runPreparerSetups(ModuleDef.java:288) at com.android.compatibility.common.tradefed.testtype.ModuleDef.run(ModuleDef.java:250) at com.android.compatibility.common.tradefed.testtype.CompatibilityTest.run(CompatibilityTest.java:477) at com.android.tradefed.invoker.TestInvocation.runTests(TestInvocation.java:796) at com.android.tradefed.invoker.TestInvocation.prepareAndRun(TestInvocation.java:471) at com.android.tradefed.invoker.TestInvocation.performInvocation(TestInvocation.java:322) at com.android.tradefed.invoker.TestInvocation.invoke(TestInvocation.java:984) at com.android.tradefed.command.CommandScheduler$InvocationThread.run(CommandScheduler.java:558) Caused by: com.android.tradefed.targetprep.TargetSetupError: Failed to create virtualenv at com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer.startVirtualenv(VtsPythonVirtualenvPreparer.java:281) at com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer.setUp(VtsPythonVirtualenvPreparer.java:98) at com.android.compatibility.common.tradefed.testtype.ModuleDef.runPreparerSetup(ModuleDef.java:344) ... 8 more 



 解决方法: 1、首先从好的电脑上拷贝cd /usr/lib/python2.7 到有问题的电脑上,将有问题的电脑的/usr/lib/python2.7备份或者删除 

 2、确认pip和virtualenv可用 

 3、安装 sudo pip install enum sudo apt-get install python-dev

 sudo apt-get install python-protobuf protobuf-compiler 

sudo apt-get install python-virtualenv python-pip 




CTS-INSTSNT:


执行命令

run cts-instant --shard-count

测试单项

run cts-instant -m (模块) -t(项)

测试模块

run cts-instant -m (模块)



----------------------------------------------------------------------------------------------

工具下载链接:


GTS:https://support.google.com/androidpartners_gms/answer/9124364?hl=en&ref_topic=7512278  


 CTS:https://source.android.com/compatibility/cts/downloads (下载工具和手动后缀为ARM 

VTS:https://support.google.com/androidpartners_gms/answer/9124917 (ARM 32 bit, non-A/B、、、、ARM non-A/B)


  STS: https://drive.google.com/drive/folders/0B3nHabi4VfI8fnZZOWwwMEJlUHhoWE4tUVRaa3R1bmdnQTNPTm05ejZVTUVLM3g0OWVKRWc https://drive.google.com/drive/folders/1uQBNz0bO1tSV4k3wktw3lI5EnMUsm8Ev


GO: https://drive.google.com/drive/folders/1gEK3fbNuJYcOi3kfYAdrr1-fNFHiUnAb?usp=sharing 

8.1GO性能测试工具下载链接

https://drive.google.com/file/d/1PiXnzlcc4lB8grKYODVhclFHGfvGZwwU/view?usp=sharing

-----------------------------------------------------------------------------------------

ADB 显示未授权:


sudo adb kill-server

sudo adb start-server

------------------------------------------------------------------

ITS:

测试命令

. build/envsetup.sh

 python tests/scene1/test_exposure.py camera=1

python tools/run_all_tests.py camera=0 scenes=0

-----------------------------------------------------------------

cts gts各有一个模块测试会检测的预制第三方app ---------CtsPermission2TestCases

-----------------------------------------

日常:


禁止重启:--disable-reboot

adb shell getprop ro.product.cpu.abi---查看手机cpu是多少位