Flutter xcodebuild: error: Unable to find a destination matching the provided destination specifier
Asked Answered
H

4

32

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

Haveman answered 4/7, 2023 at 8:17 Comment(0)
H
73

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
Haveman answered 6/7, 2023 at 15:8 Comment(6)
2023 everything last version this trick worked for meSarpedon
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.5Countersink
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"; }Humpage
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.Hanks
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.Fovea
This did not work for me. My issue is that XCode is complaining that I do not have iOS 17.5 installed, though I have 17.4 installed and the device on which I test has 17.4.1 installed. I suspect XCode is attempting 17.5 because it can't find my device, but this solution did not help the device to be found as a run destinationCarchemish
C
5

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

Camisado answered 20/5, 2024 at 8:57 Comment(0)
T
1

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
Thumbprint answered 18/5, 2024 at 12:23 Comment(0)
J
1

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

Jaqitsch answered 27/7, 2024 at 12:41 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.