Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

To run an iOS app on the Simulator, open your project in Xcode, pick a Simulator device from the run-destination menu, and press Cmd+R. Xcode builds the app, boots the Simulator, installs the build, and launches it. To debug it, set breakpoints in the gutter and run again. When execution pauses on a breakpoint, the Debug area opens with the LLDB console and variables view so you can inspect state, step through code, and evaluate expressions. You can also drive everything from the terminal with the xcrun simctl command line.
The iOS Simulator ships only with Xcode on macOS, so the prerequisites are a Mac, a current version of Xcode from the Mac App Store, and at least one installed simulator runtime (for example, iOS 18 on an iPhone 16 Pro). If your run-destination menu has no devices listed, you first need to add a runtime. The steps for that are covered in How to Install iOS Simulators?. Once Xcode and at least one simulator are in place, you are ready to build and run.
The fastest path is the Xcode build-and-run flow. It compiles the app, boots the chosen Simulator, installs the build, and launches it in one action.
If you only want to bring up a Simulator without building a project, you can boot one from the terminal and open the Simulator app window:
# List the available simulators and their UDIDs
xcrun simctl list devices
# Boot a simulator by name (or UDID)
xcrun simctl boot "iPhone 16 Pro"
# Open the Simulator app so you can see the booted device
open -a SimulatorWhen you already have a built .app bundle (from CI, a colleague, or a prior build), you can install and launch it on a booted Simulator without opening Xcode. The booted keyword targets whichever simulator is currently running.
# Install a built app bundle onto the booted simulator
xcrun simctl install booted /path/to/MyApp.app
# Launch it by its bundle identifier
xcrun simctl launch booted com.example.MyApp
# Stop the app when you are done
xcrun simctl terminate booted com.example.MyAppThis command-line workflow is what most CI pipelines and automation frameworks use under the hood to put a build on a simulator before running tests against it.
Debugging on the Simulator uses the same tools you would use on a real device, because Xcode attaches the LLDB debugger to the process either way. The main facilities are:
When you want to drive the debugger directly, the most common LLDB commands during a paused session look like this:
(lldb) breakpoint set --name viewDidLoad # break on a method by name
(lldb) run # start or resume the app
(lldb) po self.someProperty # print an object's description
(lldb) p count # evaluate a value expression
(lldb) bt # show the current backtrace
(lldb) frame variable # list local variables in this frameOutside Xcode, you can tail the booted simulator's unified log with simctl spawn. Filtering with a predicate keeps the output limited to your app instead of the entire system.
# Stream all debug-level logs from the booted simulator
xcrun simctl spawn booted log stream --level=debug
# Limit the stream to your app's process
xcrun simctl spawn booted log stream \
--predicate 'processImagePath endswith "MyApp"'The Simulator can reproduce many runtime conditions so you can debug code paths that are hard to trigger by hand. A few of the most useful:
# Open a deep link in the booted app
xcrun simctl openurl booted "https://example.com/promo"
# Set a static GPS location (latitude,longitude)
xcrun simctl location booted set 37.3349,-122.0090
# Capture a screenshot and record a video
xcrun simctl io booted screenshot shot.png
xcrun simctl io booted recordVideo demo.mp4A clean simulator is often the quickest fix for stale caches, leftover login state, or odd install behaviour. Note that you cannot erase a simulator while it is booted, so shut it down first.
# Shut the device down before erasing it
xcrun simctl shutdown "iPhone 16 Pro"
# Erase content and settings back to a clean state
xcrun simctl erase "iPhone 16 Pro"
# Or wipe every simulator at once
xcrun simctl erase allIn the Simulator app itself, the equivalent action is Device > Erase All Content and Settings. If a simulator refuses to boot or repeatedly crashes rather than just holding stale data, see How to Troubleshoot Simulator Errors?, and for sluggish behaviour, How to Handle Performance Issues with the Simulator?.
The Simulator runs your app compiled for your Mac's architecture, which makes it fast to iterate on but means it is not a perfect stand-in for a physical device. Keep these gaps in mind when you decide what a passing run on the Simulator actually proves.
| Capability | iOS Simulator | Real iPhone |
|---|---|---|
| Camera | No hardware camera; APIs return mocked or empty data | Real front and rear cameras |
| Push notifications | No real APNs; can simulate a payload via xcrun simctl push (Xcode 11.4+) | True APNs delivery |
| GPS and motion sensors | Simulated location only; no accelerometer, gyroscope, or barometer | Real GPS and motion hardware |
| Biometrics | Face ID and Touch ID are simulated via the Features menu | Real Face ID and Touch ID hardware |
| Performance and thermals | Uses Mac CPU and GPU; not representative of device speed or battery | Accurate on-device performance, thermals, and battery |
This is the same trade-off you weigh on Android with an emulator. The Android equivalent of this workflow is covered in Run and Debug Apps on the Emulator.
The Simulator is excellent for the fast inner loop of writing code and stepping through it, but before release you still want to validate camera flows, push notifications, biometrics, and real performance on actual hardware. Maintaining a shelf of physical iPhones and iPads for every iOS version is expensive, which is where a real device cloud helps. With TestMu AI's Real Device Cloud you can install your build on a remote, physical iPhone or iPad, interact with it live in your browser, capture logs and video, and reproduce the device-only bugs the Simulator simply cannot surface, without managing any local hardware.
Open your project in Xcode, choose a Simulator device from the run-destination menu in the toolbar, and press Cmd+R (or Product > Run). Xcode builds the app, boots the Simulator, installs the build, and launches it. From the terminal you can boot a simulator with xcrun simctl boot and start an installed app with xcrun simctl launch booted <bundle id>.
Set breakpoints by clicking the gutter next to a line, then run with Cmd+R. When execution hits a breakpoint, the Debug area opens with the LLDB console and variables view. Use console commands such as po, p, bt, and frame variable to inspect state, step through code with F6/F7/F8, and watch the Debug navigator gauges for CPU and memory.
Boot a simulator, then run xcrun simctl install booted /path/to/MyApp.app to install the build and xcrun simctl launch booted com.example.MyApp to start it by bundle identifier. The booted keyword targets the currently running simulator, which is what CI pipelines rely on.
Shut the device down first with xcrun simctl shutdown <device>, then run xcrun simctl erase <device> to wipe its content and settings. You cannot erase a booted simulator. In the Simulator app you can also choose Device > Erase All Content and Settings.
The Simulator has no physical camera, GPS, or motion sensors, so those APIs return mocked or empty data, and push notifications are not delivered through real APNs. Xcode 11.4 and later let you simulate a remote push by dragging an .apns payload onto the Simulator or using xcrun simctl push. For genuine camera, sensor, and push behaviour you need a real iPhone or a real device cloud.
Print statements and os_log output appear in the Xcode Debug area console as the app runs. From the terminal you can stream the booted simulator's unified log with xcrun simctl spawn booted log stream, optionally filtered with a predicate so you only see your app's messages.
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.

TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance