Flutter iOS Emulator
Xcode is Apple’s integrated development environment (IDE) that you use to build apps for Apple products including the iPad, iPhone, Apple Watch, and Mac. Xcode provides tools to manage your entire development workflow—from creating your app, to testing, optimizing, and submitting it to the App Store.
You don’t need to have Xcode running to use the Emulator but you can launch the Emulator from XCode.
iOS EmulatorXcode ships with an iOS simulator/emulator. In addition to running code, the simulator enables you to test the following with virtual iOS devices:
Simulating various GPS coordinates
Simulating low memory scenarios
Open iOS Simulator/Emulator
Open from Xcode
Select the ‘Xcode’ menu then ‘Open Developer Tool then ‘Simulator’.
Opening from Command-LineUse the following command in your terminal.
Run Your App on the iOS Simulator
When you have the Simulator(s) open (running), the simulator(s) become available on the main toolbar in the first dropdown, to the left of the run configuration dropdown & run/debug buttons:
If you have more than one simulator running, they will all be displayed
in the dropdown on the main toolbar.
Visual Studio Code
When you have the Simulator(s) running, the currently-selected simulator is displayed on the toolbar on the bottom right. The current simulator is the one that will be used when the user selects ‘Start Debugging’ or ‘Start Without Debugging’ on the popup menu for a runnable file.
If you have multiple simulators running, you can select between simulators by clicking on the simulator displayed on the toolbar on the bottom right. This opens a menu at the top to enable the user to select in between them.
You start your iOS simulator(s) as required then you use the ‘flutter run’ command to run your app with an open device or emulator.
If you invoke ‘flutter run’ without any devices or emulators, you get a message similar to that below:
If you invoke ‘flutter run’ without multiple devices or emulators open, you get a message similar to that below:
The command below runs the app on the iPhone 6s:
Remember that if you only have one device or emulator open, you just do a ‘flutter run’: