Skip to content

Start iOS Simulator Not Shows in VS Code after updating Flutter 1.22 #2844

Closed

Description

@Safnaj

Describe the bug
When running flutter application on Mac VS Code, it was prompt asking Start iOS Simulator or Create Android Simulator. Once we select iOS Simulator it will simply open XCode Simulator. After New Update the device option shows only Create Android Emulator.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Devices in the Bottom Bar of VS Code'
    OR
  2. Cmnd+shft+P then choose Start Emulator

Expected behavior
It should show Start iOS Simulator & Create Android Emulator both options.

Screenshots
image

Versions (please complete the following information):

  • VS Code version: 1.49.2
  • Dart extension version: 3.15.0
  • Dart/Flutter SDK version: 1.22

Activity

  1. DanTup commented on Oct 2, 2020

    @DanTup
    Member

    Can you post the full output of flutter doctor -v? I've seen this happen if your Xcode is out of date (flutter/flutter#42751 / flutter/flutter#42254) but it was almost a year ago I hit that.

    If it's not that, please check your project has an ios folder, and post the full output of flutter devices -v. Thanks!

  2. added
    awaiting infoRequires more information from the customer to progress
    on Oct 2, 2020
  3. Safnaj commented on Oct 2, 2020

    @Safnaj
    Author
    [✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.4 19E2269, locale en-GB)
        • Flutter version 1.22.0 at /Users/Shared/Dev/flutter
        • Framework revision d408d302e2 (3 days ago), 2020-09-29 11:49:17 -0700
        • Engine revision 5babba6c4d
        • Dart version 2.10.0
    
    [✗] Android toolchain - develop for Android devices
        ✗ Unable to locate Android SDK.
          Install Android Studio from: https://developer.android.com/studio/index.html
          On first launch it will assist you in installing the Android SDK components.
          (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
          If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
          You may also want to add it to your PATH environment variable.
    
    
     
    [✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.0.1, Build version 12A7300
        • CocoaPods version 1.9.3
    
    [!] Android Studio (not installed)
        • Android Studio not found; download from https://developer.android.com/studio/index.html
          (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
    
    [!] IntelliJ IDEA Ultimate Edition (version 2020.2)
        • IntelliJ at /Applications/IntelliJ IDEA.app
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
        • For information about installing plugins, see
          https://flutter.dev/intellij-setup/#installing-the-plugins
    
    [✓] VS Code (version 1.49.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.15.0
    
    [!] Connected device
        ! No devices available
    
    ! Doctor found issues in 4 categories.
    
  4. Safnaj commented on Oct 2, 2020

    @Safnaj
    Author

    Once i stated the simulator using XCode, its appears as below. But previously i could start iOS Simulator from here as well.

    Screenshot 2020-10-02 at 11 44 36 PM

  5. DanTup commented on Oct 2, 2020

    @DanTup
    Member

    @Safnaj if you close down the simulator and restart VS Code, does it show up again now you've run it once? (I've seen some issues where I had to run Xcode once after an update before everything worked correctly).

  6. Safnaj commented on Oct 2, 2020

    @Safnaj
    Author

    I checked by restarting VS Code, XCode and the Mac

  7. Safnaj commented on Oct 3, 2020

    @Safnaj
    Author

    @DanTup Any solutions ?

  8. DanTup commented on Oct 3, 2020

    @DanTup
    Member

    @Safnaj do you have an ios folder in your project?

    Could you post the output of running flutter emulator -v and also the following:

    • Run the Dart: Capture Logs command
    • Untick Analysis Server but leave everything else ticked and click OK
    • Click the device selector on the status bar to open the popup
    • Click Cancel on the logging notification to open the log
    • Paste the log here

    Thanks!

  9. Safnaj commented on Oct 3, 2020

    @Safnaj
    Author

    Output of flutter emulator -v

    safnaj@Safnajs-MacBook-Pro ~ % flutter emulator -v
    [ +129 ms] executing: [/Users/Shared/Dev/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
    [  +44 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
    [        ] d408d302e22179d598f467e11da5dd968dbdc9ec
    [        ] executing: [/Users/Shared/Dev/flutter/] git tag --points-at HEAD
    [  +14 ms] Exit code 0 from: git tag --points-at HEAD
    [        ] 1.22.0
               1.22.0-12.3.pre
    [  +10 ms] executing: [/Users/Shared/Dev/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
    [   +5 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
    [        ] origin/stable
    [        ] executing: [/Users/Shared/Dev/flutter/] git ls-remote --get-url origin
    [   +5 ms] Exit code 0 from: git ls-remote --get-url origin
    [        ] https://github.com/flutter/flutter.git
    [  +40 ms] Unable to locate an Android SDK.
    [   +7 ms] executing: [/Users/Shared/Dev/flutter/] git rev-parse --abbrev-ref HEAD
    [   +6 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
    [        ] stable
    [   +5 ms] executing: sw_vers -productName
    [  +17 ms] Exit code 0 from: sw_vers -productName
    [        ] Mac OS X
    [        ] executing: sw_vers -productVersion
    [  +15 ms] Exit code 0 from: sw_vers -productVersion
    [        ] 10.15.4
    [        ] executing: sw_vers -buildVersion
    [  +15 ms] Exit code 0 from: sw_vers -buildVersion
    [        ] 19E2269
    [  +49 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
    [   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
    [   +7 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
    [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
    [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
    [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
    [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
    [  +52 ms] "flutter emulators" took 77ms.
    [   +5 ms] Unable to find any emulator sources. Please ensure you have some
               Android AVD images or an iOS Simulator available.
    [   +1 ms] 
               #0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
               #1      EmulatorsCommand.runCommand (package:flutter_tools/src/commands/emulators.dart:37:7)
               #2      FlutterCommand.verifyThenRunCommand
    (package:flutter_tools/src/runner/flutter_command.dart:972:18)
               #3      _rootRunUnary (dart:async/zone.dart:1198:47)
               #4      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
               #5      _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
               #6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
               #7      Future._propagateToListeners (dart:async/future_impl.dart:725:32)
               #8      Future._completeWithValue (dart:async/future_impl.dart:529:5)
               #9      Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
               #10     _rootRun (dart:async/zone.dart:1190:13)
               #11     _CustomZone.run (dart:async/zone.dart:1093:19)
               #12     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
               #13     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
               #14     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
               #15     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
               #16     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
               #17     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
               
               
    [ +279 ms] ensureAnalyticsSent: 276ms
    [   +1 ms] Running shutdown hooks
    [        ] Shutdown hooks complete
    [   +1 ms] exiting with code 1
    
  10. Safnaj commented on Oct 3, 2020

    @Safnaj
    Author

    Output of Dart: Capture Logs

    !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
    
    Dart Code extension: 3.15.0
    Flutter extension: 3.15.0 (activated)
    
    App: Visual Studio Code
    Version: 1.49.2
    Platform: mac
    
    Workspace type: Flutter
    Analyzer type: DAS
    Multi-root?: false
    
    Dart SDK:
        Loc: /Users/Shared/Dev/flutter/bin/cache/dart-sdk
        Ver: 2.10.0
    Flutter SDK:
        Loc: /Users/Shared/Dev/flutter
        Ver: 1.22.0
    
    HTTP_PROXY: undefined
    NO_PROXY: undefined
    
    Sat Oct 03 2020 [17:30:29 GMT+0530 (India Standard Time)] Log file started
    [5:31:59 PM] [General] [Info] Checking 1 projects for supported platforms
    [5:31:59 PM] [FlutterDaemon] [Info] ==> [{"id":"4","method":"daemon.getSupportedPlatforms","params":{"projectRoot":"/Users/safnaj/Documents/SLIIT/Research/2020-103/Emotely"}}]
    [5:31:59 PM] [FlutterDaemon] [Info] <== [{"id":"4","result":{"platforms":["ios","android"]}}]
    [5:31:59 PM] [General] [Info] Supported platforms for the workspace are ios, android
    [5:31:59 PM] [FlutterDaemon] [Info] ==> [{"id":"5","method":"emulator.getEmulators"}]
    [5:31:59 PM] [FlutterDaemon] [Info] <== [{"id":"5","error":"NoSuchMethodError: The getter 'emulatorPath' was called on null.\nReceiver: null\nTried calling: emulatorPath","trace":"#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)\n#1      AndroidEmulators._getEmulatorAvds (package:flutter_tools/src/android/android_emulator.dart:59:45)\n#2      AndroidEmulators.emulators (package:flutter_tools/src/android/android_emulator.dart:55:43)\n#3      EmulatorManager.getAllAvailableEmulators.<anonymous closure> (package:flutter_tools/src/emulator.dart:81:41)\n#4      Future.forEach.<anonymous closure> (dart:async/future.dart:512:26)\n#5      Future.doWhile.<anonymous closure> (dart:async/future.dart:554:26)\n#6      _rootRunUnary (dart:async/zone.dart:1198:47)\n#7      _CustomZone.runUnary (dart:async/zone.dart:1100:19)\n#8      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)\n#9      _CustomZone.bindUnaryCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1042:26)\n#10     _rootRunUnary (dart:async/zone.dart:1198:47)\n#11     _CustomZone.runUnary (dart:async/zone.dart:1100:19)\n#12     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)\n#13     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)\n#14     Future._propagateToListeners (dart:async/future_impl.dart:725:32)\n#15     Future._completeWithValue (dart:async/future_impl.dart:529:5)\n#16     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)\n#17     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)\n#18     EmulatorManager.getAllAvailableEmulators.<anonymous closure> (package:flutter_tools/src/emulator.dart)\n<asynchronous suspension>\n#19     EmulatorManager.getAllAvailableEmulators.<anonymous closure> (package:flutter_tools/src/emulator.dart)\n#20     Future.forEach.<anonymous closure> (dart:async/future.dart:512:26)\n#21     Future.doWhile.<anonymous closure> (dart:async/future.dart:554:26)\n#22     _rootRunUnary (dart:async/zone.da…
    [5:31:59 PM] [General] [Error] NoSuchMethodError: The getter 'emulatorPath' was called on null.
    Receiver: null
    Tried calling: emulatorPath
    Sat Oct 03 2020 [17:32:03 GMT+0530 (India Standard Time)] Log file ended
    
    

    @DanTup

  11. Safnaj commented on Oct 4, 2020

    @Safnaj
    Author

    @DanTup seems something missing in my logs.

  12. DanTup commented on Oct 5, 2020

    @DanTup
    Member

    It looks like there's a bug in the latest Flutter that would failt o return any emulators when the Android SDK is missing. I've filed a bug at flutter/flutter#67293 and a PR to fix at flutter/flutter#67295.

    I'm not sure of any workaround in the meantime except setting up an Android SDK.

  13. removed
    awaiting infoRequires more information from the customer to progress
    on Oct 5, 2020
  14. 6 remaining items

  15. added this to the v3.16.0 milestone on Oct 5, 2020
  16. Safnaj commented on Oct 12, 2020

    @Safnaj
    Author

    @DanTup is this issue going to be fixed in next release ??

  17. DanTup commented on Oct 12, 2020

    @DanTup
    Member

    @Safnaj the issue was fixed in Flutter. I would expect it to be in the next major Flutter release, but I don't know when that is (I think there has just been a stable release so it might a little way off). As a workaround in the meantime, you could set up an Android SDK to prevent the issue (which could just be the command line tools, or enough to pass the doctor checks).

  18. avinashk369 commented on Jan 4, 2021

    @avinashk369

    The fix has landed in Flutter's master channel so closing this. It may take some times to work its way through the other channels of course.

    Screenshot 2021-01-04 at 11 46 20 AM

    no device in master channel as well.

  19. DanTup commented on Jan 4, 2021

    @DanTup
    Member

    @avinashk369 is there an ios folder in your project? If not, can you try running flutter create . in your project to create it (I've opened #3045 to make this easier in future).

    If you do, could you enable the Flutter Daemon log and provide the output in a new issue (I don't think it's the same as this issue).

    Thanks!

  20. iampawan commented on Jan 18, 2021

    @iampawan

    @DanTup Sometime VSCODE suddenly stops showing the iOS devices, It gets fixed after some time automatically. I don't know what is the issue

  21. DanTup commented on Jan 18, 2021

    @DanTup
    Member

    @iampawan the issue noted above was fixed in Flutter but hasn't made the stable branch yet. However it's unlikely to be intermittent (it's based on whether you have an Android SDK). If you can reproduce another issue, please try enabling the flutter daemon log and next time you see it, grab a copy of that log and file a new issue. Thanks!

  22. shaon2016 commented on Jun 20, 2021

    @shaon2016

    Do this,

    Open Xcode and go to preferences - > locations - > Command Line Tools and select Xcode 10 or above

    Then close the vscode and open it. you will see ios Simulator option there. but previously you must close simulator also

  23. maulikTeksun commented on Jul 7, 2021

    @maulikTeksun

    Do this,

    Open Xcode and go to preferences - > locations - > Command Line Tools and select Xcode 10 or above

    Then close the vscode and open it. you will see ios Simulator option there. but previously you must close simulator also

    Its resolved my issue

  24. kleyos commented on Jul 22, 2021

    @kleyos

    I solved this issue by launching

    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    sudo xcodebuild -runFirstLaunch
    

    reload vscode window

  25. adityaguptagkp30 commented on Aug 10, 2021

    @adityaguptagkp30

    my simulator also stopped working when i added splash screen images in the runner/assets.... folder I am not sure but the error is due to irregular size of the images added in the 1x,2x and 3x images

  26. AdityaNawandar commented on Feb 16, 2022

    @AdityaNawandar

    Do this,

    Open Xcode and go to preferences - > locations - > Command Line Tools and select Xcode 10 or above

    Then close the vscode and open it. you will see ios Simulator option there. but previously you must close simulator also

    Worked. Need not even close the simulator.

  27. BellatoJAIST commented on Jan 26, 2023

    @BellatoJAIST

    Do this,

    Open Xcode and go to preferences - > locations - > Command Line Tools and select Xcode 10 or above

    Then close the vscode and open it. you will see ios Simulator option there. but previously you must close simulator also

    its worked, thank you very much.

  28. KeerthikaChokkalingam commented on Mar 23, 2024

    @KeerthikaChokkalingam

    Do this,

    Open Xcode and go to preferences - > locations - > Command Line Tools and select Xcode 10 or above

    Then close the vscode and open it. you will see ios Simulator option there. but previously you must close simulator also

    I have tried this but my issue was not resolved.

  29. muhammadsalif commented on Jan 15, 2025

    @muhammadsalif

    How I Solved the Issue with the Simulator Not Showing Up:

    After some troubleshooting, I followed these steps, which worked perfectly:

    1. Open Xcode Settings.
    2. Navigate to the Command Line Tools dropdown.
    3. Re-select Xcode 14.3.1 (14E300c) from the list (even if it’s already selected).
    4. Close the settings.
    5. Relaunch VS Code.
    6. Check the simulator – it should now be visible!

    This resolved the issue for me. I hope this helps other developers facing the same problem! 🚀

    Attaching screenshot below for reference.
    xCode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions