Flutter : Not Connecting to IOS Simulator in Android Studio
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:
As pointed out by others:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
:
sudo xcodebuild -runFirstLaunch
Solution 4
I fixed this problem by flowing these steps and refreshing the list of simulators
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
Android Ninja
Updated on July 09, 2022Comments
-
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 errorNo devices attached.
-
returnVoid almost 5 yearsI 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 over 4 yearsWorks! Android Studio immediately after executing this command, detected iPhone simulator.
-
erluxman about 4 yearsThis works but can you explain what it does as well ?
-
Hiren Dabhi about 4 yearsAlternatively you can set command line tool from Xcode. stackoverflow.com/questions/55745783/…
-
Stick almost 3 yearsthis is savage!
-
sibin over 2 yearsThis worked thanks...
-
Anil Gupta over 2 yearsYes, when I run it worked with M1 mac.
-
Boris over 2 yearsworked for me too! Thank you!!!
-
Jay Tillu about 2 yearsI'm using flutter. And this works on VS Code as well.