Flutter can't connect to iOS simulator - flutter

I created first flutter app on Mac.
but I can't build it on iOS simulator.
when I build it;
an iOS simulator will run.
and wait.
vs Code say to me;
-Cannot launch without an active device
-Failed to launch iOS Simulator: Error: Emulator didn't connect within 60 seconds
IDE : vs Code
my Macbook : MacBook Pro 2011 early
macOs version : high Sierra
flutter version : 13.8
xcode version : 9.4

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

at the first run bellow command
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
and then
sudo xcodebuild -runFirstLaunch
after than run "flutter devices"
now you see ios simulators if running

I have also same issue
follow these instruciton:
Xcode -> Prefrences -> locations -> select your command line tols

Which device do you use as a Simulator? From the docs:
Make sure your simulator is using a 64-bit device (iPhone 5s or later)
by checking the settings in the simulator’s Hardware > Device menu.
Run flutter doctor. Are there any errors?

I have the same problem. Flutter doesn't see any simulators.
Flutter required now Xcode 10.2 minimum. You can't run 10.2 on high sierra, therefore use flatter.

If you have multiple Xcode and don't have Xcode With default name "Xcode", this problem may occur. Try to rename one of xcode to "Xcode"

The major issue is with XCode. To quickly fix the issue, open project on XCode(make sure you choose the /ios path inside your flutter project.) and Open Preferences. On preferences dialog, go to Location and choose a command line tool from given option.
Restart your IDE.

In my case (with VS Code) I just had to quit the simulator app in my dock and select the simulator again.

I had the same problem , also I've been trying to solve it with all these solutions here, I solved it when I I deleted ios folder and wrote flutter create . in the terminal

I had many problems with flutter stable version before,
Try to change it to Dev version

Related

All devices targets on xcode become "unavailble"

I have tried to install xcode 4.6 together with my existing xcode 6.3.
I have face issues during installation.
one of the solutions was to run this command:
/Developer/Library/uninstall-devtools --mode=all
after that i could not run under devices , for all devices that i have it gives me this error :
did any one face this before ?
UPDATE :
itunes also can not see my devices.
I have reinstalled xcode but no changes.
I Think you will be able to find out some helpful points from these links.
Xcode iOS project only shows "My Mac 64-bit" but not simulator or device
Ineligible Devices section appeared in Xcode 6.x.x
Xcode doesn't see my iOS device but iTunes does
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYourApponDevices.html
still if it is not done please apologize me.
Reinstalling the Mac OS resolved the problem.

Error when opening simulator with iOS 8 beta

I have recently installed Xcode 6 beta in OS X Mavericks, with which comes the iOS simulator for iOS 8.
using this new Xcode I have create one new project and run it on simulator with iOS 8, but when opening the simulator, it always get the error
Unable to boot the iOS Simulator
So, pls tell me how to solve this error?
Quit both the simulator and Xcode. If that doesn't fix it, reboot your Mac.
Welcome to the world of beta builds!
Be sure you "select" your new Xcode version before launching / downloading updates.
sudo xcode-select -switch /Applications/Xcode6-Beta6.app/Contents/Developer/
If you're already seeing Simulator troubles, try rebooting too.
Make sure that you load X-Code 6 and not 5.
Run your project.
If fails to load, try clicking on the menu at the top on the iOS Simulator button and reset the device. Resetting the device seems to do the trick for me.
Also, make sure you are on the laatst x-code version

IOS 5.0.1 With XCode 4.2.1 Saying "does not match any of the versions of iOS"

I am currently on Xcode 4.2.1 and I am running an IPad 1 using 5.0.1. However, I am getting this error message:
The version of iOS on “Personal iPad” does not match any of the
versions of iOS supported for development with this installation of
the iOS SDK. Please restore the device to a version of the OS listed
below, or update to the latest version of the iOS SDK; which is
available here.
OS Installed on Personal iPad
5.0.1 (9A405)
Xcode Supported iOS Versions
That's right! It is giving me absolutely no supported iOS versions. I have seen other posts about this for older versions of Xcode/IOS, but they also had supported versions.
Edit: I can run the program just fine in the iOS device simulator. It runs in IOS 5. Also, my provisioning profiles are listed under the device and they have matched my certificate in the KeyChain.
Ok! I downloaded the installer program for XCode. Uninstalled XCode and reinstalled it through the installer program and it works like a charm.
So, I ran this to uninstall it:
sudo /Developer/Library/uninstall-devtools –mode=all
Then I just used the installer from the App Store and now it works just fine with my iPad.
Thanks.
I didn't need to uninstall xcode.
just start the installer and press "update"...
For those who wan't to avoid upgrading Xcode, do the following:
Download the Xcode version dmg containing the iOS SDK you need
Make sure Xcode is not running
Double click the downloaded Xcode dmg, right click the Xcode.app icon, choose "Show Package Content"
Copy Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs (on you local machine)
Copy Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneSimulator.platform/Developer (on you local machine)
Copy Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ to /Developer/Platforms/iPhoneOS.platform/DeviceSupport (on you local machine)
Right click Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/, choose "Make Alias", rename the alias to "Latest"
Start Xcode

iOS simulator only list the latest iOS version. How can I set earlier versions

According to the documentation should be able to choose which iOS version the simulator should run, however only the latest 4.3.2 is listed under "Hardware/Version".
The helps says:
"To set the iOS release used in the simulation environment, choose Hardware > Version, and choose the version you want to test on."
I don't want to support 3.x (although it would be nice) but at least I want to simulate my app on 4.2, 4.1 and 4.0.
What's going on? Why aren't they listed?
UPDATE:
I'm on Lion so I cannot install an earlier version of Xcode. Before my Upgrade I could test different versions easily.
the problem is that you have no other Simulator SDK installed which can be used. As #dorada has mentioned you have to install an older Xcode which in fact doesn't work because you're using Lion. I haven't tried it with Lion but principally it should work like before with Snow Leopard.
I'm referencing to my other answer how to get an older Xcode (don't know if it's still working)
After you have an older Xcode version, mount the image an navigate with terminal to that volume. There should be a hidden folder Packages. open that folder with open . and locate the two .pkg files you need (e.g. iPhoneSDK4_0.pkg and iPhoneSimulatorSDK4_0.pkg) and install both.
They will appear in your root directory and you have to move them to your Developer dir (don't simply overwrite, it will delete all other SDKs. go to the last different folder it should be iPhoneSimulator4.0.sdk\ and copy that one)
DONE (and at that point I have verified it: it works on my Lion. I used the dvd image which I have started backup'ing since 3.2.1)
Although iPortable has the correct answer I decided to post a step-by-step guide which is easer to follow:
Download Xcode 3.1
Mount the dmg file
In Finder menu select "Go\Go to folder" and enter "/Volumes/Xcode and iOS SDK/Packages"
Install the simulators you need (Double click)
Copy the simulation folders from /Platforms/iPhoneSimulator.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
If your have some SDK missing Install the missing SDK from "/Volumes/Xcode and iOS SDK/Packages" and copy subfolders from /Platforms/iPhoneOS.platform/DeviceSupport/ to /Developer/Platforms/iPhoneOS.platform/DeviceSupport/ (for me they were all there from 3.1 to 4.3)
you may download the older ios sdk / xcode from . https://developer.apple.com/downloads/index.action
(i found this answer in another stack overflow topic actually, but now i can not seem to find that question!)
Open Xcode and in the menu at the top left, where you select what device to run on, click "More Simulators..."
The download section of Xcode preferences will open,
Click the "Components" tab.
You will see a list of simulators that can be installed, click install on version you need.
The simulator will need to restart to install.
To run the newly installed version of the simulator just select it from the run menu in Xcode.
You actually have to install previous simulator versions, they aren't there on a new install.
Maybe you can search and download them somewhere? - we keep them on a shared drive at the office.
After installing the Xcode 4.2 for Snow Leopard, I noticed there was a choice for iPad 3.2 Simulator, but using it just brings up some alerts that say "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." and another alert that says "Simulated application quit. Click Relaunch to try again." with Quit, Switch SDK, and Relaunch buttons.
I can successfully use iPhone 4.0 Simulator, iPhone 4.1 Simulator, iPad 4.2 Simulator, etc up to iPad/iPhone 5.0 Simulator, but really would like to have iPad 3.2 Simulator and iPhone 3.1.3 Simulator and earlier down to 3.0 if possible.
Our apps generally run all the way back to 3.0 and we occasionally receive bug reports from earlier iOS users, and would love to be able to debug these issues more effectively.
I tried the technique summarized by Tibidabo and although I am able to copy the simulator folders as mentioned, and though they show up as choices in Xcode, I cannot get them to actually run as simulators and I get the same problem alerts mentioned above.
What are other developers doing to support debugging of older iOS versions?
Go to Project Settings -> Summary an change Deployment Target.

The version of iPhone OS on “” does not match any of the versions of iPhone OS supported for development with this copy of Xcode

I have followed Apples tutorial and upgraded my iphone to 3.0. But i get this error:
OS Installed on
3.0 (7A341)
Xcode Supported iPhone OS Versions
3.0 (7A312g)
2.2.1
And when i try to run an application on my iphone xcode states:
No provisioned iPhone OS device is connected.
What have I missed?
Stumbled across this question because I've had the same problem with 3.0.1. Apple has an advisory (PDF) about how to get XCode to stop worrying and love the 3.0.1. It boils down to running a command in Terminal:
ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1
It looks like you need to upgrade xcode to the newest version of the SDK as well as your iPhone / iPod Touch to the newest version of the SDK. It looks like your XCode is from beta 5 where your iPhone is GM.
Both XCode and the iPhone OS need to be the most recent version to install apps. In addition, you will need to reenable the iPhone for development after every software upgrade in the XCode device manager.
Look in the organizer window if the phone is in orange state ..then just restart the phone and see.
How To:
Add an iOS SDK from a downloaded Xcode dmg:
Download the Xcode version dmg containing the iOS SDK you need
Make sure Xcode is not running
Double click the downloaded Xcode dmg, right click the Xcode.app icon, choose "Show Package Content"
Copy Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs (on you local machine)
Copy Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ to /Developer/Platforms/iPhoneSimulator.platform/Developer (on you local machine)
Copy Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ to /Developer/Platforms/iPhoneOS.platform/DeviceSupport (on you local machine)
Right click Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/, choose "Make Alias", rename the alias to "Latest"
Start Xcode
I have solved this as Pluckyglen said, but will add that this is a way to cheat XCode about the version of the Device.
Creating a unix Symbolic link:
ln -s <´Xcode version´> <´Device Version´>
makes Xcode think that the device version is a supported version, cause we are making the dev version just a link to one of the supported versions.
At least this is what I understood :P