Chicowitz
Chicowitz

Reputation: 5939

ios simulator: how to close an app

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?

Upvotes: 208

Views: 124886

Answers (13)

Saranya Subramanian
Saranya Subramanian

Reputation: 461

this screenshot may be helpful . Click the simulator then go to Device -> App Switcher

enter image description here

Upvotes: 2

Aleksandr Skobeltcyn
Aleksandr Skobeltcyn

Reputation: 511

Check setting bar -> device -> App Switcher:

Now you can swipe the app up to close it

Upvotes: 1

Jerry Sam
Jerry Sam

Reputation: 111

Easy way, just click on "Device" menu then select "App Switcher".

Upvotes: 3

You can also kill the app by process id

ps -cx -o pid,command | awk '$2 == "YourAppNameCaseSensitive" { print $1 }' | xargs kill -9

Upvotes: 0

Keshav Gera
Keshav Gera

Reputation: 11264

Command + shift +h Press H 2 times

Note :- Press H 2 times

Upvotes: 8

Rishabh Arya
Rishabh Arya

Reputation: 272

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

Upvotes: 13

Ray Hunter
Ray Hunter

Reputation: 15557

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.

close app on simulator

Upvotes: 91

matt
matt

Reputation: 625

Window / Show Device Bezels

And now you can see the real device, so double tap on HOME button and kill you app

Upvotes: 11

Chicowitz
Chicowitz

Reputation: 5939

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.

Upvotes: 112

Archit
Archit

Reputation: 1006

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.

Upvotes: 17

lehn0058
lehn0058

Reputation: 20257

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.

Upvotes: 352

Tulon
Tulon

Reputation: 4136

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

Upvotes: 6

Tony
Tony

Reputation: 4609

Double click on the home button and then click and hold the icon like a normal phone and then click close I believe.

Upvotes: 5

Related Questions