Automate Screenshots on iPhone Simulator?

后端 未结 6 1663
耶瑟儿~
耶瑟儿~ 2020-12-23 02:13

I\'m tired of taking new screenshots everytime I change my UI for my iPhone application. I would like to be able to run a script/program/whatever to load my binary on the si

6条回答
  •  心在旅途
    2020-12-23 02:25

    Inside the iPhone Simulator, there is a "Copy Screen" menu item. It replaces the Copy menu item in the edit menu when you hold down Control. The keystroke is Ctrl-Cmd-C A simple AppleScript could copy a ScreenShot and save it. Something like (it worked for me, even if it is hacky):

    tell application "iPhone Simulator" to activate
    tell application "System Events"
        keystroke "c" using {command down, control down}
    end tell
    tell application "Preview" to activate
    tell application "System Events"
        keystroke "n" using {command down}
        keystroke "w" using {command down}
        delay 1
        keystroke return
        delay 1
        keystroke "File Name"
        keystroke return
    end tell
    

    If you don't get it, please comment...

提交回复
热议问题