xcodebuild test : Could not launch simulator: -10827
Go to the apple
icon (top left of screen), then force quit
then select the simulator
Run the project again
I had exact same issue. It happens because Mac OS X doesn't allow an iOS simulator to run in the BACKGROUND.
If you are constructing a Jenkins CI environment, and trying to unit test via the simulator, you can't run the simulator, because Jenkins is basically run as a DAEMON. This also happens if you're running the tests behind environments like tmux or screen.
Here is a great tutorial to read that can help you fix this.
Cheers!
For me this helped - close XCode & Simulator (if running) - open Terminal and type:
ps -ax | grep simdeviceio | grep -v grep
this had some output on my Mac:
50755 ?? Ss 0:00.67 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/Resources/SimStreamProcessorServices.simdeviceio/Contents/XPCServices/SimStreamProcessorService.xpc/Contents/MacOS/SimStreamProcessorService
50756 ?? Ss 0:00.07 /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/Resources/SimAudioProcessorServices.simdeviceio/Contents/XPCServices/SimAudioProcessorService.xpc/Contents/MacOS/SimAudioProcessorService
This 2 processes could either manually be killed by typing their PIDs (first number in above lines) with a kill command:
kill -9 50755 50756
or with
ps ax | grep simdeviceio | grep -v grep | awk '{print $1}' | xargs kill -9