How to Start Emulator Direct From VS Code or Terminal
In this post, we are going to show you how to start Android or iOS emulators directly from Visual Studio Code (VS Code) or from the terminal. It will help you to start emulators easily without opening Android Studio or XCode.
List Available Emulators:
flutter emulators
This command will list all the emulators available for testing. If you do not have any emulator yet, you must create one with the ADV Manager of Android Studio or from XCode for iOS. The output will be like below:
Id • Name • Manufacturer • Platformapple_ios_simulator • iOS Simulator • Apple • iosPixel_3a_API_34_extension_level_7_x86_64 • Pixel_3a_API_34_extension_level_7_x86_64 • Google • android
Here, you will notice the ID of the emulator, its name, and the platform.
Read Also: Flutter CLI – Useful Commands for Flutter Developers
Launch Emulator:
flutter emulators --launch <emulator id>
Now run the above command with the emulator ID from the emulators list. For Example:
flutter emulators --launch apple_ios_simulator
This command will run the emulator with ID “apple_ios_simulator”.
[Archived image missing]
Now, List The Available devices:
After starting the emulator, make sure it is available for application testing by following the command:
flutter devices
The output of this command will be as follows:
Found 3 connected devices: iPhone 16 Plus (mobile) • 3D2F3D29-3E80-4041-A6FE-FC79AE337A66 • ios • com.apple.CoreSimulator.SimRuntime.iOS-18-5 (simulator) macOS (desktop) • macos • darwin-x64 • macOS 15.3.2 24D81 darwin-x64 Chrome (web) • chrome • web-javascript • Google Chrome 140.0.7339.133
Now you can run the application on the above connected devices with the following command:
flutter run -d <device_id>
For Example: flutter run -d 3D2F3D29-3E80-4041-A6FE-FC79AE337A66 or flutter run -d apple_ios_simulator
In this way, you can launch the emulator from VS Code or Terminal and run your application.