Ste*_*his 17 android screen emulation rotation android-emulator
我想在模拟器上测试手机的旋转,我看到我们必须使用的所有地方Ctrl+F11但它只旋转模拟器的图像并且不会启动配置更改事件或重绘活动.
这是我用的Ctrl+F11:

那么,我必须使用什么来模拟真正的旋转?
小智 48
你也可以这样做:
禁用加速度计控制旋转 - 只需执行一次
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
Run Code Online (Sandbox Code Playgroud)
旋转景观:
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
Run Code Online (Sandbox Code Playgroud)
旋转肖像:
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
Run Code Online (Sandbox Code Playgroud)
旋转倒置景观:
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:3
Run Code Online (Sandbox Code Playgroud)
旋转颠倒肖像:
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:2
Run Code Online (Sandbox Code Playgroud)
如果您具有WRITE_SETTINGS权限,则还可以通过Java代码中的内容提供程序进行编写.
正如 Nicolas Jafelle在这里建议的,您可以尝试在模拟器设置中添加属性“键盘支持-->是”。这对我有帮助。
PS:它还允许您的模拟器从键盘获取输入。在这里查看更多内容
| 归档时间: |
|
| 查看次数: |
17609 次 |
| 最近记录: |