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 Emulator
Xcode ships with an iOS simulator/emulator. In addition to running code, the simulator enables you to test the following with virtual iOS devices:Device rotation
Simulating various GPS coordinates
Device shake
Simulating low memory scenarios
Open iOS Simulator/Emulator
Open from Xcode
Select the ‘Xcode’ menu then ‘Open Developer Tool then ‘Simulator’.
Opening from Command-Line
Use the following command in your terminal.open -a Simulator
Run Your App on the iOS Simulator
Android Studio
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.
Command-Line
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:
flutter run
No connected devices.
Run 'flutter emulators' to list and start any available device emulators
If you invoke ‘flutter run’ without multiple devices or emulators open, you get a message similar to that below:
flutter run
More than one device connected; please specify a device with the '-d <deviceId>'
flag, or use '-d all' to act on all devices.
iPhone 6s • 34B92793-1355-4E13-857B-D5E7A3FB4F4F • ios • iOS 12.1
(simulator)
iPhone XR • D49E45DA-7D58-473A-B0FA-29E3C4E88455 • ios • iOS 12.1
(simulator)
The command below runs the app on the iPhone 6s:
flutter run -d 34B92793-1355-4E13-857B-D5E7A3FB4F4F
Remember that if you only have one device or emulator open, you just do a ‘flutter run’:
flutter run