Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switch the screen mode with MonkeyRunner?

How can I use MonkeyRunner to switch the screen mode(Portrait mode and Landscape mode)?

like image 994
Martin Avatar asked Dec 31 '25 20:12

Martin


2 Answers

There is no such way.

like image 130
Android Boy Avatar answered Jan 02 '26 09:01

Android Boy


There is a indirect way,you can toggle between portrain & landscape, but only the setting page.Steps:-

1.Disable auto-rotate screen option in settings page,keep the same page open.
2.Keep device in horizontally(It wont go to landscape mode as auto rotate is disabled
3.Get coordinates of disable/enable by enabling 'show pointer location'
4.touch the cordinates using monkeyrunner-it will goto landscape,touch again it will goback to portrait.

like image 32
Rilwan Avatar answered Jan 02 '26 09:01

Rilwan