I can currently rotate the display for my application from my espresso test by doing:
val currentActivity = getCurrentActivity()
currentActivity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
getInstrumentation().waitForIdleSync()
However, this will only rotate the display; the emulator itself remains in portrait mode. I have the auto-rotate setting turned to on / rotate contents of the screen.
Does anyone know how to get the emulator to also rotate?