我使用 monkeyrunner 脚本在 Windows 上通过 GenyMotion 模拟器测试 APK。脚本是否可能旋转模拟设备?
最佳答案
谢谢 Nir H。
我在同一个文件夹中创建了脚本 - rotate.bat
,代码如下:
"c:\Program Files\Genymobile\Genymotion\genyshell.exe" -c "rotation setangle %1"
并从 monkeyrunner 中将其称为(旋转 90 度并向后旋转的示例):
...
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 - 如何使用 Android 模拟器使用 monkeyrunner 模拟屏幕旋转?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28516890/