1、直接设置问题
estUnknownSourcesOffByDefault
fail
junit.framework.AssertionFailedError: Deviceshould not ship with ‘Unknown Sources’ enabled by default.expected:<0> butwas:<1> atandroid.provider.cts.Settings_SecureTest.testUnknownSourcesOffByDefault(Settings_SecureTest.java:183)
这种fail最好解决,直接按照字面理解就OK,设置—安全—默认关闭:未知来源。
2、permission
– testSensorFeatures
fail
junit.framework.AssertionFailedError:PackageManager#hasSystemFeature(android.hardware.sensor.accelerometer)returns true but SensorManager#getSensorList(1) shows sensors []expected: butwas: atandroid.app.cts.SystemFeaturesTest.assertFeatureForSensor(SystemFeaturesTest.java:300)
一般情况修改 - > frameworks/base/data/etc/*.xml 文件,例如
android.hardware.camera.xml,platform.xml等文件,这边的文件定义了设备具有的一些权限。
android.app.cts.SystemFeaturesTest#testSensorFeatures FAIL
junit.framework.AssertionFailedError: PackageManager#hasSystemFeature(android.hardware.sensor.light) returns true but SensorManager#getSensorList(5) shows sensors [] expected: but was:
原因:手机无光感
解决方法:去除…\mediatek\config{PROJECT}\android.hardware.sensor.light.xml及
android.hardware.sensor.proximity.xml文件中相应选项
3、由测试而引起的非测试项出错
– testRecordingHint
fail
java.lang.RuntimeException: start failed. atandroid.media.MediaRecorder.start(Native Method)
这种情况要根据Logcat去查看RuntimeException的具体错误。通常可以先不改,因为很难查错。
4、网络问题
– test_isReachable
fail
java.net.UnknownHostException: Unable to resolvehost “www.google.com”: No address associated with hostname atjava.net.InetAddress.lookupHostByName(InetAddress.java:426)
这类问题是由于国内的网络无法访问国外网站导致的,最好的办法就在公司搭建一个VPN,链接出去。
5、系统文件权限
– testAllFilesInSysAreNotWritable
fail
junit.framework.AssertionFailedError: Foundwritable:
[/sys/devices/platform/malata_ts.0/tsclass/tsclass0/ts_power,/sys/devices/platform/malata_ts.0/tsclass/tsclass0/ts_en_file,/sys/devices/platform/malata_ts.0/tsclass/tsclass0/ts_Calibrate] atandroid.permission.cts.FileSystemPermissionTest.
testAllFilesInSysAreNotWritable(FileSystemPermissionTest.java:364)
– testNoSetuidTcpd