When you "run" the simulator from xCode, the app automatically launches, and then you can click the home button to suspend the app. What I want to do is close the app from within the simulator. So, how can this be done?
-
Please anyone share any automated process, some settings tweak which will kill the app in simulator when stop switch pressed for xcode 7.1 or later. I'm tierd of killing my app from double home tap & swipe up :( – Ratul Sharker Dec 21 '15 at 09:17
-
@RatulSharker: Have you found the solution? I am on the same page, too tired to of trying the double home tap and swiping up. But all efforts in vain. Help! – Archit Dec 23 '15 at 14:00
-
1@RatulSharker: Finally found one...!! After enormous amount of Brute Force..! Press: Shift+Command+Swipe up using the Touchpad. – Archit Dec 23 '15 at 14:04
-
:P i work on mac mini, no touchpad, i was intended to solution like change some preference in xcode or simulator :( – Ratul Sharker Dec 23 '15 at 15:41
-
@RatulSharker as long as it is your own app, you can kill it from the IDE – lucidbrot Mar 13 '19 at 13:53
13 Answers
You can also do it with the keyboard shortcut shown under the simulator menu bar (Hardware-> Home).
The shortcut is ⌘+⇧+H, but you need to hit H twice in a row for it to simulate the double press that shows the apps.

- 31,873
- 11
- 70
- 114

- 19,977
- 15
- 69
- 109
-
3By the way, trying this in iOS 7 presents screenshots of each running app; just swipe the screenshot upward to close it – Chicowitz Oct 23 '13 at 13:08
-
2@bababooey your comment should be one of the answers. I could not figure out how to do this and I looked for this everywhere! Btw, for anyone else that stumbles here, swipe up the screenshot not the icon. – septerr Dec 05 '13 at 03:32
-
1
-
FYI : iOS 8.1 does not terminate app when *Hardware -> Home* clicked. It just keeps app in background – Apurva Jun 07 '16 at 07:15
-
6Note to Future Self: That "up arrow" is Shift and not the keyboard "Up" arrow, kept wondering why it didn't work. – Mike R Jun 04 '17 at 19:52
-
https://stackoverflow.com/a/46371726/1229612 this is getting a lot of upvotes and might be the better current answer – Chicowitz Jun 18 '19 at 13:18
-
-
1Perhaps worth adding: I sometimes have to do the double hit on ⌘+⇧+H, 3-4 times to finally simulate the showing of the currently running apps. Persistence pays off in this case. – RonH Jan 12 '20 at 13:50
-
I use XCode 12.2 and iPhone 8 simulator. I pressed home + shift + h (twice). It works randomly for me. If I am lucky, it works once in a three or four times – Adem Sep 18 '21 at 12:47
For iOS 7 & above:
- shift+command+H twice to simulate the double tap of home button
- swipe your app's screenshot upward to close it
You'll see screenshots representing the apps suspended on your device - those screenshots respond to touch events. Swiping is the gesture you'll make to "fling" the screenshot off of the screen. Note that on machines where your mouse is intended to represent your finger, you'll click and swipe as if it is your finger tapping and making the gesture.

- 5,759
- 5
- 32
- 38
-
7Not a fare call bro, the Q was asked you and was responded by @lehn0058 on Aug 29 '13 correctly, now to get easy upvotes, you accepted your answer and modified by copying his. Not a fare call at all. Atleast mention the deserving persons name. – Nicks Apr 27 '17 at 00:40
-
@Shyam It just needs to be quick. Quicker than on an actual iPhone. At least that is my experience with the new Xcode 11 – Kelly Bang Sep 23 '19 at 20:31
On the new iPhone X, the simulator was having issues with the mouse/finger gesture.
You can do a long press with the mouse and a close icon will appear. You can use the swipe up gesture as well to close the app.

- 15,137
- 5
- 53
- 51
-
1
-
6Go to app, hold mouse at bottom of screen (just below black line) and swipe up bringing the thumbnail to the centre of screen and release. Now long hold mouse over app and the close button will appear. Tap it to close the app completely. – Philip Murphy Mar 07 '18 at 01:14
-
2Is there a keyboard shortcut for iphoneX only?, I was used to the (shift+cmd+H)+H to bring background apps but cant make it work for iphonex sim – sweepez Jun 07 '18 at 04:40
-
1FYI iOS12+ you need to swipe up this window to kill previously that sends it to background – Kamaldeep singh Bhatia Oct 18 '18 at 11:07
I had a difficult time in finding a way in XCode 7.2, but finally I had found one. First press Shift+Command+ H twice. This will open up all the apps that are currently open.
Swipe left/right to the app you actually want to close. Just Swipe Up using the Touchpad while Holding the App would close the app.

- 976
- 16
- 28
Window / Show Device Bezels
And now you can see the real device, so double tap on HOME button and kill you app

- 607
- 7
- 20
You can use this command to quit an app in iOS Simulator
xcrun simctl terminate booted com.apple.mobilesafari
You will need to know the bundle id of the app you have installed in the simulator. You can refer to this link

- 212
- 5
- 10
For closing (not quit) the running application in Simulator the keyboard shortcut is "shift+command+h".

- 4,011
- 6
- 36
- 56
Double click on the home button and then click and hold the icon like a normal phone and then click close I believe.

- 4,609
- 2
- 22
- 32
-
This did close the app. I was hoping that I could select my app from the applist and then launch it again and continue debugging it from xCode; when I tried this, I got a SIGKILL exception. – Chicowitz Aug 29 '13 at 20:18
-
1@bababooey yes, a SIGKILL is the correct behaviour. There is no point re-opening it, because the program gets terminated when closed, so you are starting with a fresh new runtime when you re-open it. – Dave Aug 29 '13 at 20:19
-
That is common because at the time you close the app xcode is still attached i believe.... try hitting the stop button after you close then try opening again maybe. It is a little hard to know since I am not there haha – Tony Aug 29 '13 at 20:20
-
Ok, maybe I'll create a new question then; what I'm trying to do is to test launching my app from a URL; I wanted to launch it from a URL without having my app suspended in the background – Chicowitz Aug 29 '13 at 20:23
-
Does this help? http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html is that what you are looking for? – Tony Aug 29 '13 at 20:25
-
@Tony I've taken this approach, now I just want to test my link *without* having my app in a suspended state (since I had to press the home button to launch safari and open my test site) – Chicowitz Aug 29 '13 at 20:27
-
new question - http://stackoverflow.com/questions/18521276/ios-how-to-debug-launching-from-url – Chicowitz Aug 29 '13 at 21:30
Check setting bar -> device -> App Switcher:
Now you can swipe the app up to close it

- 451
- 5
- 10
You can also kill the app by process id
ps -cx -o pid,command | awk '$2 == "YourAppNameCaseSensitive" { print $1 }' | xargs kill -9

- 161
- 3
- 7