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?
11 Answers
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.
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.
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