51

I have built a Flutter app. Everything was working fine until I tried to launch it on a physical device. After struggling to find a solution, I changed the Xcode configuration from debug to release and I am now able to launch the app on the physical device (by running flutter run --profile). But now, I can not succeed in launching it on the simulator. I receive the error :

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
            { id:C80BB36C-4498-4641-92D8-F69090A819A9 }

When I plug the device and run flutter run --profile, he asks me on which profile I want to run the app:

[1]: iPhone de Bernard (00008110-0012642011B8801E)
[2]: iPhone 14 (C80BB36C-4498-4641-92D8-F69090A819A9)
[3]: macOS (macos)
[4]: Chrome (chrome)

The iPhone 14 that Flutter proposes in the profiles is the one that is not found when I try to run the app from Android Studio on the simulator for iPhone 14.

Flutter doctor :

[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F82 darwin-arm64, locale fr-BE)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

and Xcode 14.3.1

7 Answers 7

123

Thanks to this thread, my problem is solved.

Briefly:

  1. Open Xcode
  2. Click Runner (Root)
  3. Click Build Settings
  4. Change "supported platforms" from Iphoneos to iOS
Sign up to request clarification or add additional context in comments.

9 Comments

2023 everything last version this trick worked for me
I had similar issues when trying to test older iOS versions like 15.5, turns out when I opened my xcode the iOS Deployment target is at 16.4 so I had to update to 15.5
works for me. if you use xcodeproj (ruby tool for modifying xcode project file), try this : frameworkTarget.build_configurations.each{ |config| config.build_settings["SUPPORTED_PLATFORMS"] = "iphonesimulator iphoneos"; }
This solution just worked for me (Dec 2023) after updating from XCode 14.2 to 15.1 & MacOS from Monterey to Sonoma (and iOS Simulator iOS 16.4 to iOS 17.2). Physical iPhone running 16.4 was unaffected / could still be targeted for release build.
This worked for me. I had setup multiple schemes in my app. For the debug configurations of all the schemes, the platform was set to IOS but for all others (release, profile), it was set to iphoneos. Changing those to IOS fixed this issues.
|
13

If you have recently upgraded your Xcode, you must download latest iOS version to run your app.

If you are unable to do so using steps provided by Gabriel:-

  1. Open Xcode
  2. Go to Xcode > Settings > Platforms > Click on + > iOS
  3. Download the latest iOS version

You can try this method:

  1. Open Xcode
  2. Click Runner (Root)
  3. Find download option on top of the screen

Downloading IOS 17.5

Comments

5

In my case, the problem happened because I changed the Build Configuration in the Runner Scheme from Debug to Release in Xcode. I did this to run the app on a real device independent of the dev machine since Flutter apps don't allow that in debug mode.

This worked fine until I tried a regular debug session on an emulator using my usual VSCode workflow. What I didn't realize is that instead of permanently altering the Xcode Runner scheme, I could've just used flutter run --release for that session.

By changing the scheme in Xcode, it caused the release configuration to be used even when running via flutter run or the VSCode run button. The reason it was saying it "can't find" the emulator wasn't because it wasn't there, but because the Xcode build configuration overrides the default config and for Flutter apps, Release mode isn't valid for an iOS emulator—you can't run a Flutter app in release mode on an iOS emulator (I think?)

So, my solution was to switch the Build Configuration back to Debug in the Xcode Runner scheme and use flutter run --release when needed in the future.

3 Comments

I don’t think it’t true in general that you can’t run an app on the simulator in release mode, but changing the scheme in Xcode to release does certainly break building for the simulator for Flutter. Thanks for this, this was exactly what I needed!
Thanks! Coming back to this answer for the second time. This was my issue. I do need to find out how to run it wirhout constantly changing schema back and forth.
Thank you for your answer. This was exactly what was happening to me.
3

if you have two Xcode installed, remenber to select to the correct Xcode version,for me,this issue is I have installed Xcode14 and Xcode15, my iPhone 15 simulator need Xcode15 version to find it. so xcode-select -s /Applications/Xcode15.app

1 Comment

It work for me , just switch newer xcode version.
3

I had the same issue, and for me, just downloading the latest iOS version 17.5 fixed the issue.

To download the latest iOS:

  1. Open Xcode
  2. Go to Xcode > Settings... > Platforms
  3. Download the latest iOS version

Comments

0

Was running into this issue with the simulators

Solution for me was just to create a new Runner scheme

https://forums.developer.apple.com/forums/thread/691414

Comments

0

For, the only solution was to add this option to xcodebuildin CI config:

xcodebuild -downloadPlatform iOS

Thanks to this message.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.