The Simulator gives you an idea of how your app would look and behave if it were running on a device. It can model a number of different types of hardware—all the screen sizes and resolutions for both iPad and iPhone—so you can simulate your app on every device you're developing for.
To run the app in the Simulator, perform the following steps:
- Click the Scheme menu in the toolbar and you will see a list of Simulators. Choose iPhone 11 from this menu:
- Click the Play button to install and run your app on the currently selected Simulator. You can also use the command + R keyboard shortcut.
- If you see the Developer Tools Access dialog box, enter the Mac's admin Username and Password and click Continue:
- The Simulator app will launch and show a representation of an iPhone 11. Your app displays a white screen, as you have not yet added anything to your project:
- Switch back to Xcode and click on the Stop button (or type Command - .) to stop the currently running project.
You have just created and run your first iOS app in the Simulator! Great job!
If you look at the Scheme menu, you may be wondering about what the No Device and Build Only Device menu items are for. Let's take a look at them.