flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
164.38k stars 27.12k forks source link

flutter emulators --launch cannot find and launch named iOS simulators #72293

Open jmagman opened 3 years ago

jmagman commented 3 years ago

No emulator found that matches 'iPhone 12'.

$ flutter emulator --launch "iPhone 12"   
No emulator found that matches 'iPhone 12'.

Only $ flutter emulator --launch apple_ios_simulator "works" but it just launches the Simulator app, not a particular simulator.

This code should be swapped to xcrun simctl boot to launch particular simulators by ID instead of just launching the app: https://github.com/flutter/flutter/blob/537cf33a21773e4ec6a4bd620a08e9fe9cfdfe99/packages/flutter_tools/lib/src/ios/ios_emulators.dart#L70-L76

https://github.com/flutter/flutter/blob/537cf33a21773e4ec6a4bd620a08e9fe9cfdfe99/packages/flutter_tools/lib/src/ios/ios_emulators.dart#L42-L48

darshankawar commented 1 year ago

Sharing my findings here from latest master version (Channel master, 3.5.0-6.0.pre.17)

Still seems to be the case, although error is different:

dhs@Dhss-MacBook-Pro cloud_functions_example % flutter devices
3 connected devices:

iPhone 13 (mobile) • 3BD8F2FF-FDB5-4074-8C91-54F99C79156D • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
macOS (desktop)    • macos                                • darwin-x64     • macOS 12.2.1 21D62 darwin-x64
Chrome (web)       • chrome                               • web-javascript • Google Chrome 106.0.5249.103
dhs@Dhss-MacBook-Pro cloud_functions_example % flutter emulator --launch "iPhone 13"
Unable to find any emulator sources. Please ensure you have some
Android AVD images or an iOS Simulator available.
dhs@Dhss-MacBook-Pro cloud_functions_example %