kill iOS Simulator from terminal
Solution 1
Use killall "iPhone Simulator"
With XCode 6, use killall "iOS Simulator"
(thanks @gempewsaw)
With XCode 7, use killall "Simulator"
(thanks @Stanislaw)
With XCode 8, killing the Simulator process is sometimes not enough, also need to kill process com.apple.CoreSimulator.CoreSimulatorService
(thanks @bensnider)
Solution 2
The proper way to shutdown simulators is xcrun simctl shutdown all
.
I don't recommend shutting down simulators by killing CoreSimulator.
Simulator.app is just a viewer (as of Xcode 9). It does not need to be launched and so does not need to be shut down either. It will respond to devices booting and shutting down automatically.
You can also hold down Option when quitting to detach from running simulators without shutting them down. Check the checkbox to make that the default behavior.
Similarly you can hold down Control when closing a window via File, Close to get a similar choice when closing a single simulator's window.
Solution 3
I agree with the answers above. Just wanted to add that I noticed my Jenkins job was failing when there was no simulator to kill. I got around this by adding it like this:
killall "iOS Simulator" || echo "No matching processes belonging to you were found"
Good luck with your ci!
Solution 4
Please try
killall -9 "iPhone Simulator"
![Claus](https://i.stack.imgur.com/UDjoz.png?s=256&g=1)
Claus
Updated on June 04, 2022Comments
-
Claus about 2 years
I'm trying to terminate the iOS Simulator from the terminal console (needed for integrating automatic UI Testing in Jenkins),but every time I try the command:
killall SimulatorBridge
a prompt waiting for action gets displayed:
The problem is that the simulator doesn't get dismissed until an action on the prompt is taken. How to get rid of it?
-
gempesaw over 9 yearson mavericks with xcode 6.1, I had to do
killall "iOS Simulator"
. Thanks for the starting point :D -
bensnider almost 8 yearsOn Xcode 8 killing the Simulator process is sometimes not enough. I also have to kill the process
com.apple.CoreSimulator.CoreSimulatorService
. -
Michael Eakins over 5 yearsHow this isn't the best answer is beyond me. +1 for simplicity!
-
SushiHangover about 5 yearsThis should be the accepted answer in 2019... (FYI: if running Xamarin-based UITests or remote simulator, add
sudo
as processes are not owned by "you") -
Charles Offenbacher about 5 yearsThese answers look good for legacy but for 2019 xcode 10 I had to use stackoverflow.com/a/54359898/573180
-
Maboo about 4 yearsThe solution that should popup as first result for any search of this question. +1
-
minusf over 3 yearstoo bad sometimes it still leaves some
com.apple.CoreSimulator.CoreSimulatorService
running... -
russbishop over 3 yearsYes, CoreSimulatorService manages the database of simulators among other things. You shouldn't be killing it. The service restarts automatically when upgraded. You are likely to cause random problems by killing it.
-
A. K. almost 3 yearsThis should be the answer. I should have found this earlier, that would have saved me a ton of time and some embarassment. One of the scripts went berserk and launched a ton of simulator instances and no bash magic would work unless I just restarted my computer.