Search code examples
flutterios-simulator

Flutter vscode does not automatically choose correct simulator


I am having some issues related to flutter detecting the ios simulator I am using.I think I may have deleted a file that I should not have?

When I run flutter run Vscode is not detecting the correct simulator that I have running instead I'm getting this output

(base) juliapak@julias-MacBook-Air coffeesociety % flutter run
Connected devices:
sdk gphone64 arm64 (mobile) • emulator-5554                        • android-arm64  • Android 13 (API 33) (emulator)
iphone 14 promax (mobile)   • 63D54239-A58D-4E24-8D89-901EA6209734 • ios            •
com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
macOS (desktop)             • macos                                • darwin-arm64   • macOS 13.4 22F66 darwin-arm64
Chrome (web)                • chrome                               • web-javascript • Google Chrome 113.0.5672.126

No wireless devices were found.

[1]: sdk gphone64 arm64 (emulator-5554)
[2]: iphone 14 promax (63D54239-A58D-4E24-8D89-901EA6209734)
Please choose one (or "q" to quit): 

This is what my VScode looks like:

enter image description here

As you can see I have the ios simulator selected. Here is the output of flutter doctor -v

(base) juliapak@julias-MacBook-Air ~ % flutter doctor -v
[✓] Flutter (Channel stable, 3.10.3, on macOS 13.4 22F66 darwin-arm64, locale
    en-CA)
    • Flutter version 3.10.3 on channel stable at /Users/juliapak/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f92f44110e (5 days ago), 2023-06-01 18:17:33 -0500
    • Engine revision 2a3401c9bb
    • Dart version 3.0.3
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/juliapak/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.78.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.66.0

[✓] VS Code (version 1.79.0-insider)
    • VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
    • Flutter extension version 3.67.20230601

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554                        •
      android-arm64  • Android 13 (API 33) (emulator)
    • iphone 14 promax (mobile)   • 63D54239-A58D-4E24-8D89-901EA6209734 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)             • macos                                •
      darwin-arm64   • macOS 13.4 22F66 darwin-arm64
    • Chrome (web)                • chrome                               •
      web-javascript • Google Chrome 113.0.5672.126

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Solution

  • When multiple devices are listed, it will ask to select one device when using flutter run command.

    To run all connected devices:

    flutter run -d all
    

    To run the specific device

    flutter run -d DEVICE_ID
    

    For Example in your case, DEVICE_ID is 63D54239-A58D-4E24-8D89-901EA6209734

    flutter run -d 63D54239-A58D-4E24-8D89-901EA6209734