Reputation: 1036
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.
Upvotes: 75
Views: 54933
Reputation: 67
if you have downloaded the beta version of xcode you can use this command, and your problem will go away.
sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
Upvotes: 0
Reputation: 747
This error showed up after I updated my Xcode.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Your IDE (Android Studio or IntelliJ) will detect the IOS Simulator as soon as you click return.
Upvotes: 18
Reputation: 232
I had different issue why IOS simulator was not appearing in fresh installation - dart sdk was not configured. I've clicked run->run there it was showing that dart is not configured, I've added flutter/bin/cache/dart-sdk in config and after that iphone simulator has appeared. Of course I followed other steps: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch
Upvotes: 0
Reputation: 1831
I have to use three steps:
running this two commands :
1) sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
2) flutter clean
3)
I have to select on Android studio Ide - (on the simulator select button drop down left hand side of main.dart showing) I have to select "Open IOS emulator".
Then the simulator run. And the simulator was Auto select on the emulator selected section.
I have used Android Studio Bumble Bee and Xcode 13.
The summary is, I think, I have to open the simulator first, then its come to online with Android studio.
Upvotes: 3
Reputation: 309
I fixed this problem by flowing these steps and refreshing the list of simulators
Upvotes: 5
Reputation: 1
I Fixed this issue like this:
which this will delete all content and settings of the simulator but the problem of hide in the android studio devices will be fix.
Upvotes: 0
Reputation: 771
Also make sure that you have agreed to Xcode licenses via running the command,
sudo xcodebuild -license
Upvotes: 2
Reputation: 3604
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
Upvotes: 252
Reputation: 1072
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
Upvotes: 34
Reputation: 470
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.
Upvotes: 37
Reputation: 140
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
Upvotes: 2
Reputation: 3356
I came across this problem on my MacBook.
iOS toolchain - develop for iOS devices (Xcode 8.2.1) ✗ Flutter requires a minimum Xcode version of 9.0.0. Download the latest version or update via the Mac App Store.
Xcode was not updated. That is why IOS simulators are not supported.
Upvotes: 1