Android Emulator Orientation Change Through Emulator Console or ADB

99封情书 提交于 2019-12-03 09:04:17

Finally I figure out a way to do it.

First I will try to clarify the question a little bit:

usually people talking about 'rotate' the AVD screen actually mean changing the skin layout to portrait/landscape (Mimic rotation of the tablet). Which can be done by press "7/9" key on number keypad or press ctrl+Fn+F12. In this case, the direction of the display will not change, sometimes the display will be annoying Left-to-right or right-to-left, in stead of natural up-to-bottom. This can be solved by uncheck the auto-rotation in android setting.

However, in some case we would like to see the effect of the gravity sensor. I think this is actually related to the OP's question. Unlike the GPS, there is no GUI tools of Eclipse to do this. The OP is very close to solve the problem. However, the orientation sensor is not the correct one, we need to use the gravity/acceleration sensor to rotate the screen automatically. try following command and observe the display direction with auto-rotation on:

sensor set acceleration 9.77622:0:0
sensor set acceleration 0:9.77622:0
sensor set acceleration 0:0:9.77622
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!