How to Close an App in the iOS Simulator

Written by

in

Quick answer: Press Command+Shift+H twice to open the App Switcher on Home-button devices, then swipe the app preview up. On Face ID devices, swipe up from the bottom edge, pause, then swipe the app preview up.

Why this happens

The iOS Simulator launches your app automatically when you run a project from Xcode. During development you often need to terminate the app completely — for example, to test cold-start behavior, clear in-memory state, or verify launch-time code paths. The simulator does not provide a visible “close” button, so you must use the same gestures or keyboard shortcuts that a physical device uses.

On devices with a Home button (iPhone 8/SE and earlier) the App Switcher is invoked by a double-press of the Home button. On Face ID devices (iPhone X and later) you swipe up from the bottom edge and pause. The simulator mirrors these interactions through the Hardware menu and corresponding keyboard shortcuts.

How to fix it

1. Close an app on a Home-button simulator (iPhone SE, iPhone 8, etc.)

  1. With the simulator frontmost, press Command (⌘) + Shift (⇧) + H twice in quick succession. This simulates a double-press of the Home button and opens the App Switcher.
  2. Click and drag the app’s preview screenshot upward until it disappears off the top of the screen.
  3. Press Command (⌘) + Shift (⇧) + H once to return to the Home Screen.

Tip: You can also choose Hardware → Home from the simulator menu bar, but the double-tap requires the keyboard shortcut.

2. Close an app on a Face ID simulator (iPhone X and later)

  1. Press Command (⌘) + Shift (⇧) + H once to go to the Home Screen (simulates the swipe-up-to-home gesture).
  2. Press Command (⌘) + Shift (⇧) + H again and hold for a moment, then release. This mimics the swipe-up-and-pause gesture that reveals the App Switcher.
    – Alternatively, use the trackpad/mouse: click at the very bottom center of the simulator window, drag upward about halfway, pause briefly, then release.
  3. In the App Switcher, swipe the app preview upward with the mouse/trackpad to terminate it.
  4. Press Command (⌘) + Shift (⇧) + H once more to return to the Home Screen.

3. Terminate the app from Xcode (alternative)

If you only need to stop the process without interacting with the simulator UI:

  1. In Xcode, click the Stop button (square icon) in the toolbar, or press Command (⌘) + . (period).
  2. The app process ends and the simulator returns to the Home Screen automatically.

This method is faster when you don’t need to test the App Switcher transition.

How to prevent it

  • Use Command (⌘) + . in Xcode for the quickest way to kill the running process.
  • Remember that the simulator’s Home gesture shortcut (⌘⇧H) behaves differently depending on the simulated device type.
  • Keep the Hardware menu open while learning; it lists the current shortcuts for the active device.

FAQ

Does closing the app in the simulator delete its data?

No. Force-quitting via the App Switcher only terminates the process. The app’s sandbox (Documents, Library, etc.) remains intact. To reset all data, choose Device → Erase All Content and Settings… in the simulator menu bar.

Why doesn’t Command+Shift+H twice work on my iPhone 15 simulator?

Face ID devices don’t have a Home button, so the double-press shortcut is repurposed: the first press goes home, the second (held) opens the App Switcher. Use the swipe-up-and-pause gesture or the hold shortcut described above.

Can I script this for UI tests?

Yes. In an XCUITest you can call XCUIDevice.shared.press(.home) twice for Home-button devices, or use XCUIDevice.shared.press(.home) followed by a swipe-up gesture for Face ID devices. The XCUIApplication().terminate() API also ends the process directly.

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.