How do I reset ios simulator in the given image back to original even after any number of rotations? Basically how to reset it back to normal rotated simulator which has to be reset to normal. If it is in normal state then it turns left or right after my code gets called. How do i write an applescript to always reset it.
Below is my code for rotating it:
tell application &quot;System Events&quot;
      if menu bar item &quot;Hardware&quot; of menu bar 1 of application process &quot;Simulator&quot; exists then
        click menu item &quot;Rotate Left&quot; of menu 1 of menu bar item &quot;Hardware&quot; of menu bar 1 of application process &quot;Simulator&quot;
      else
        click menu item &quot;Rotate Left&quot; of menu 1 of menu bar item &quot;Device&quot; of menu bar 1 of application process &quot;Simulator&quot;
      end if
    end tell
On my system, using Script Editor, the following example AppleScript code works for me to reorient the Simulator window in the normal view:
tell application &quot;Simulator&quot; to activate

tell application &quot;System Events&quot; to ¬
    click menu item &quot;Portrait&quot; of ¬
        menu 1 of ¬
        menu item &quot;Orientation&quot; of ¬
        menu 1 of ¬
        menu bar item &quot;Device&quot; of ¬
        menu bar 1 of ¬
        application process &quot;Simulator&quot;