我怎么能模拟屏幕旋转与Android模拟器monkeyrunner? [英] How I can emulate screen rotation with monkeyrunner with Android emulator?

查看:916
本文介绍了我怎么能模拟屏幕旋转与Android模拟器monkeyrunner?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用monkeyrunner脚本测试APK与视窗GenyMotion模拟器。是否有可能脚本旋转模拟设备?

I use monkeyrunner script for testing APK with GenyMotion emulator at Windows. Is it possible that script rotate emulated device?

推荐答案

感谢尼尔小时。

我在与脚本相同的文件夹中创建 - rotate.bat 这个code:

I have created in the same folder with script - rotate.bat with this code:

"c:\Program Files\Genymobile\Genymotion\genyshell.exe" -c "rotation setangle %1"

和来自monkeyrunner调用它(旋转90度的例子和旋转回):

and call it from monkeyrunner as (example of rotate 90 degree and rotate it back):

...

print "rotation 90"
res = os.popen('rotate 90').read()
print res

MonkeyRunner.sleep(1)

print "rotation 0"
res = os.popen('rotate 0').read()
print res

...

和它的作品! :)

这篇关于我怎么能模拟屏幕旋转与Android模拟器monkeyrunner?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆