由于重力感应是与手机硬件相关的,所以测试起来比较麻烦,有木有办法在模拟器上模拟测试呢?这也是本人比较关心的问题,还好,确实有。那就是sensorsimulator组件。
首先介绍下测试平台:
模拟器:android2.3.3
组件:sensorsimulator1.1.1(见附件)
步骤如下:
1.安装APK,在bin目录下有个SensorSimulatorSettings-1.1.1.apk文件,可通过adb install SensorSimulatorSetting-1.1.1.apk命令安装。
2.设置SensorSimulatorSetting,安装成功后,启动模拟器,进入SensorSimulatorSetting界面,如下:
设置IP:
[img]http://dl.iteye.com/upload/attachment/0066/7707/7dce4132-9c46-3b05-a6d9-62eaab9328f2.png[/img]
设置测试模式配置:
[img]http://dl.iteye.com/upload/attachment/0066/7705/aebbab89-1eb3-3afe-b4d1-1ed5511152d7.png[/img]
有几种重力感应模式:
[img]http://dl.iteye.com/upload/attachment/0066/7709/53e660ab-b25e-3f6b-aa0a-14c889a370c0.png[/img]
Fastest:最快更新率(范围在8ms-30ms)
Game:适合游戏的更新率(40ms)
Normal:系统默认值,适合于屏幕方向
首先介绍下测试平台:
模拟器:android2.3.3
组件:sensorsimulator1.1.1(见附件)
步骤如下:
1.安装APK,在bin目录下有个SensorSimulatorSettings-1.1.1.apk文件,可通过adb install SensorSimulatorSetting-1.1.1.apk命令安装。
2.设置SensorSimulatorSetting,安装成功后,启动模拟器,进入SensorSimulatorSetting界面,如下:
设置IP:
[img]http://dl.iteye.com/upload/attachment/0066/7707/7dce4132-9c46-3b05-a6d9-62eaab9328f2.png[/img]
设置测试模式配置:
[img]http://dl.iteye.com/upload/attachment/0066/7705/aebbab89-1eb3-3afe-b4d1-1ed5511152d7.png[/img]
有几种重力感应模式:
[img]http://dl.iteye.com/upload/attachment/0066/7709/53e660ab-b25e-3f6b-aa0a-14c889a370c0.png[/img]
Fastest:最快更新率(范围在8ms-30ms)
Game:适合游戏的更新率(40ms)
Normal:系统默认值,适合于屏幕方向