If things are not rotated properly you can use the following commands to change the screen rotation.
First disable auto-rotation:
“adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0”
Set portrait:
“adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1”
Set landscape:
“adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0”