Skip to content

Instantly share code, notes, and snippets.

@luisobo
Last active January 14, 2016 14:19
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luisobo/6201428 to your computer and use it in GitHub Desktop.
Save luisobo/6201428 to your computer and use it in GitHub Desktop.
Hide iOS Simulator when running Unit Tests.

Hide iOS Simulator when running Unit Tests.

Based on this work, that @Dan2552 pointed out.

Instructions:

  1. Clone this gist (git clone https://gist.github.com/6201428.git hide_ios_simulator)
  2. Xcode -> Preferences -> Behavior -> Testing -> Generates output
  3. Run script -> Choose script -> Select hide_simulator

Enjoy!

#!/usr/bin/env osascript
if application "iPhone Simulator" is running then
set attempts to 0
tell application "Finder"
repeat while ((visible of process "iPhone Simulator" is false) and (attempts is less than 10))
set visible of process "iPhone Simulator" to false
delay 0.1
set attempts to attempts + 1
end repeat
set visible of process "iPhone Simulator" to false
end tell
end if
@va3093
Copy link

va3093 commented Jan 14, 2016

This didn't work for me. The simulator is still showing when running tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment