onrcn_
onrcn_

Reputation: 147

Flutter can't connect to iOS simulator

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

Upvotes: 13

Views: 27102

Answers (11)

Madhusudhan Sahni
Madhusudhan Sahni

Reputation: 221

I have also same issue follow these instruciton:

Xcode -> Prefrences -> locations -> select your command line tols

Same process we can check in video:- https://youtu.be/2HnOWSC-yaM

Upvotes: 1

bero
bero

Reputation: 33

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

Upvotes: 0

Rasel Khan
Rasel Khan

Reputation: 4239

I have also same issue
follow these instruciton:

Xcode -> Prefrences -> locations -> select your command line tols

Follow the image

Upvotes: 5

EHR
EHR

Reputation: 81

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

Upvotes: 0

Mehrdad
Mehrdad

Reputation: 1637

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

Upvotes: 6

Subash Neupane
Subash Neupane

Reputation: 11

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.

Upvotes: 0

devarshi
devarshi

Reputation: 71

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"

Upvotes: 0

ElsayedDev
ElsayedDev

Reputation: 650

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

Upvotes: -2

Yavuz Tarhan
Yavuz Tarhan

Reputation: 576

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

Upvotes: 43

Dmitry  Sokolov
Dmitry Sokolov

Reputation: 1383

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.

Upvotes: 2

Bassam
Bassam

Reputation: 507

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?

Upvotes: 2

Related Questions