Flutter : Not Connecting to IOS Simulator in Android Studio - ios

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.

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

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.

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

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

This error showed up after I updated my Xcode.
Open Terminal
Run the following command in Terminal
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Enter your device's password.
Your IDE (Android Studio or IntelliJ) will detect the IOS Simulator as soon as you click return.

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

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.

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.

Also make sure that you have agreed to Xcode licenses via running the command,
sudo xcodebuild -license

I Fixed this issue like this:
Open simulator
Go to "Device" in menu
Click "Erase all content and settings"
which this will delete all content and settings of the simulator but the problem of hide in the android studio devices will be fix.

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

Related

Flutter Doctor : Xcode installation is incomplete

I have an app created with Flutter want to build it in IOS.
When i want to run simulator or build the I get error ,When I run Flutter doctor I get this error L
Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
I was facing the same issue. I did not installed Xcode from Apple Store. If your scenario is same, you can try below steps,
Open Xcode
Go to Preferences -> Location tab
You will find "Command Line Tools" option. If it is blank, select the Xcode version from list (see image below). It will ask for password or Touchid to update it.
Run flutter doctor again. It should resolve the issue
You probably miss the xcode command line tools, you may want to reinstall XCode, or select the xcode command line tools with the command xcode-select
Here's a full fix that should solve your problem: https://github.com/flutter/flutter/issues/6308#issuecomment-257812324
So, I was facing this same issue, and tried to and copy paste the command already given. Namely
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
But why did it not work? Silly mistake of mine: I have two Xcode versions in my Applications folder. One is called Xcode_12_3_0 and the other Xcode_12_5_1. Make sure that, when you run the command, you also make sure you enter your app's real name. For instance:
sudo xcode-select -s /Applications/Xcode_12_5_1.app/Contents/Developer
An answer for us, absent-minded people.
If you already have Xcode and this happens. Just run this command
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
And
sudo xcodebuild -runFirstLaunch
It will automatically show

How can I configure which xcodebuild tool version is run when running react-native run ios?

After upgrading to Xcode 12, I discovered a project dependency in my larger react-native workspace needs some work to address unsupported architectures.
Until then, I want to continue working on the react-native app, so I installed Xcode 11.7 side-by-side with Xcode 12.
This works fine unless I try to start the app via the CLI tool. It appears the project is still being built by Xcode 12 (the same unsupported architecture errors I saw at compile time are output to the terminal).
which xcodebuild points to /usr/bin/xcodebuild.
What do I need to modify to have version 11.7 run the build command instead of version 12?
You can use xcode-select command to determine at which Xcode version's command line tools the xcodebuild points to:
~ xcode-select -p
/Applications/Xcode.app/Contents/Developer
You can change the selected Xcode version using -s option:
sudo xcode-select -s /Applications/PathToXcode11/Xcode.app

Not able to launch app in iOS simulator in vscode

I am new to vscode, I tried running my code in iOS simulator but its not showing the simulator in the first place.
the options i get are
view android emulators
view iOS simulators
But when I click on view iOS simulators I get a pop up saying
" Something went wrong fetching you iOS simulators! Make sure you have Xcode installed. Try running this command in your terminal: instruments -s devices "
You may need to run this command, when VSCode tries access the simulator there may be error which says
Cannot find "xcodebuild". Xcode 11.0.0 or greater is required to
develop for iOS. Encountered error while building for device.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Cannot install the flutter application for ios

I got and Error which says that "found "xcode 10.1, build version 10b61". xcode 10.2 or greater is required to develop for ios. flutter ", Tried everything, but cannot make it work.
Its working on the Xcode, but unfortunately Its not working in VS Code.
The latest Xcode version is 11.3. Please update the Xcode in your mac machine and open Xcode to complete the installation of all necessary components.
Fluter requires Xcode command-line tools. to setup command-line tool run following in your terminal:
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
$ sudo xcodebuild -runFirstLaunch
Detailed reference can be found in Fluter iOS setup. Hope this helps.
I had the same problem, my macbook is late 2011 so I couldn't update to Mojave or Catalina which is required by xcode 10.2 and above.
for people like me reaching here, I just updated my mac to Catalina (the same 2011 model) using dosdude patcher located at macOS Catalina Patcher. it works like a charm, I installed the latest xcode and now all is fine.

iOS simulators not showing in Titanium Studio

I recently updated my xcode from version 7.3 to 9.0.1 now in titanium studio simulators are not showing up inside run option. In previous version they were working fine. Also i confirmed that my xcode path in Titanium studio is correct and it shows it as "Installed" when i run some app from run configuration option i get this error.
[ERROR] : Invalid "--device-id" value "iPhone"
Available iOS Simulators:
For help, run: titanium.js help build
Please share any clue to solve this issue.
Thanks
I had same issue.
Try this command in terminal.
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
Miro

Resources