1.根据测试报告报错找到cts的源码位置------------>找到Android.bp和AndroidManifest.xml文件
2.进入编译环境
source build/envsetup.sh
lunch sys_mssi_aiot_64_arm82-user
-
在源码根目录下,make CtsContentCaptureServiceTestCases 编译出apk ------>
adb install -r -t CtsContentCaptureServiceTestCases.apk -
测试指令为:
adb shell am instrument -e class android.contentcaptureservice.cts.ResizingEditActivityTest#testInsetsChangedOnImeAction -w android.contentcaptureservice.cts/androidx.test.runner.AndroidJUnitRunner
5.解释:
adb shell am instrument -e class //固定
android.contentcaptureservice.cts.ResizingEditActivityTest#testInsetsChangedOnImeAction //测试报告上的失败项
-w android.contentcaptureservice.cts/androidx.test.runner.AndroidJUnitRunner //根据cts源码所在AndroidManifest.xml的末尾获取:
如下:
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:label="CTS tests for the AutoFill Framework APIs."
android:targetPackage="android.contentcaptureservice.cts">
</instrumentation>