9

The iPhone Simulator annoyingly pops up when I run tests in Xcode and interrupts my work flow. This is especially annoying if I'm in fullscreen mode. I want it to open and stay in the background.

If there is a solution that makes the Simulator always stay in the background (even when not testing) I'm ok with that as long as I can turn it off.

slhck
  • 235,242

2 Answers2

2

Currently, it seems that there is no support for this in Xcode or the iOS Simulator. There are a few workarounds listed here.

StackOverflow how to run tests without launching iOS Simulator

Personally, the easiest thing for me has been to use a secondary monitor, but if that is not an option, some of the other suggested workarounds are:

  1. "Command + U, followed by Command + H when launching unit tests. (Control + H hides the simulator after it appears.)" - markshiz

  2. Don't set any bundle loader or test host build settings, instead just add the .m files you are unit testing to the Build Phases Compile Sources, then run the unit tests from the command line using:

xcodebuild -verbose -target TheElementsUnitTests -configuration Debug -sdk iphonesimulator5.0 clean build

-MandyW

  1. Run an AppleScript in Generates output in Testing behavior configuration:

#!/usr/bin/osascript activate application "Xcode"

-Rudolf Adamkovic

0

In the Simulator menu on top click on "Window" -> "Stay in Front". This places the Simulator to stay always as top window above all other windows. And then minimize the Simulator Window with the small yellow dot into the dock. In this way the Simulator stays hidden in the dock and does not come forward automatically.

Darko
  • 101