I use monkeyrunner script for testing APK with GenyMotion emulator at Windows. Is it possible that script rotate emulated device?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Thanks Nir H.
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"
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
...
and its works! :)
回答2:
I'm not familiar with Monkeyrunner, but if it's possible to run a CMD line via Monkeyrunner you can run the following command:
For horizonatal:
%Your_Genymotion_installation_path%\genyshell -c "rotation setangle 90"
For vertical:
%Your_Genymotion_installation_path%\genyshell -c "rotation setangle 0"