Created
May 15, 2020 17:38
-
-
Save michaello/b2e8c133cf27db768edb711ac569c587 to your computer and use it in GitHub Desktop.
I HATE WHEN SIMULATOR BECOMES ACTIVE AFTER BUILD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
osascript <<EOD | |
set start_time to do shell script "ruby -e 'print Time.now.to_i'" | |
repeat while true | |
tell application "System Events" | |
set activeApp to name of application processes whose frontmost is true | |
if activeApp is not "Xcode" then | |
tell process "Xcode" | |
set frontmost to true | |
end tell | |
end if | |
end tell | |
set end_time to do shell script "ruby -e 'print Time.now.to_i'" | |
if end_time - start_time > 10 then | |
exit repeat | |
end if | |
end repeat | |
EOD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment