Flutter : Not Connecting to IOS Simulator in Android Studio

21,660

Solution 1

Please check whether you installed the latest version of Xcode.

After the installation, try to run the following command.

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

Solution 2

As other people have suggested, it happens when you update XCode. So, run the command in terminal suggested by Muhammed

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

Then, you probably have to run flutter clean. For it to run properly.

Solution 3

I ran into the same problem but unfortunately, @MUHAMMED IQBAL PA's solution didn't suffice. Running these two commands, however, resolved the problem:

  1. As pointed out by others:

    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    
  2. :

    sudo xcodebuild -runFirstLaunch
    

Solution 4

I fixed this problem by flowing these steps and refreshing the list of simulators

enter image description here

Solution 5

it happened to me when i have updated my Xcode, use this command to let Flutter recognize your Xcode again. sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Share:
21,660
Android Ninja
Author by

Android Ninja

Updated on July 09, 2022

Comments

  • Android Ninja
    Android Ninja almost 2 years

    I am following the Flutter Test Drive tutorial on the Flutter Docs. I installed XCode, cocoapods, ran pods setup etc.

    However, in Android Studio, when I try to run IOS by clicking "Run IOS Simulator," it opens the simulator but fails to connect.

    I also tried doing this from the terminal. Opened an IOS emulator and then ran flutter run in the app folder in terminal. I got an error No devices attached.

  • returnVoid
    returnVoid almost 5 years
    I did not need to use this command but instead just needed to restart my MBP and Android Studio was working fine. It happened for me when I updated XCode.
  • Boken
    Boken over 4 years
    Works! Android Studio immediately after executing this command, detected iPhone simulator.
  • erluxman
    erluxman about 4 years
    This works but can you explain what it does as well ?
  • Hiren Dabhi
    Hiren Dabhi about 4 years
    Alternatively you can set command line tool from Xcode. stackoverflow.com/questions/55745783/…
  • Stick
    Stick almost 3 years
    this is savage!
  • sibin
    sibin over 2 years
    This worked thanks...
  • Anil Gupta
    Anil Gupta over 2 years
    Yes, when I run it worked with M1 mac.
  • Boris
    Boris over 2 years
    worked for me too! Thank you!!!
  • Jay Tillu
    Jay Tillu about 2 years
    I'm using flutter. And this works on VS Code as well.