Fix xcodebuild: Unable to find a destination matching the provided destination specifier
Problem Statement
When developing Flutter apps for iOS, you may encounter the frustrating Xcode error:
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:C80BB36C-4498-4641-92D8-F69090A819A9 }
This error typically occurs when:
- Switching between running on physical devices and simulators
- Changing Xcode build configurations (
Release
/Debug
) - Using outdated or missing iOS simulator runtimes
- Having Xcode configuration conflicts or multiple Xcode installations
The core issue involves Xcode's inability to locate a simulator device matching the specific identifier shown in the error message. This creates a barrier to testing and development on iOS simulators after previously working configurations.
Common Trigger
This problem frequently appears after switching to --release
or --profile
mode to run on physical devices, then attempting to return to simulator testing.
Recommended Solutions
1. Revert Build Configuration in Runner Scheme (When Switching Between Device Types)
If you previously modified your Runner Scheme's Build Configuration from Debug to Release (to support physical devices), switch it back:
Steps:
1. Open ios/Runner.xcworkspace in Xcode
2. Go to Product > Scheme > Edit Scheme
3. Under 'Run', set Build Configuration to 'Debug'
Why this works:
Flutter apps cannot run in Release
mode on iOS simulators. Changing the scheme forces debug builds for simulators. Always use flutter run --release
specifically for physical devices rather than changing the base scheme configuration.
Alternate Terminal Method:
flutter clean
flutter config --no-enable-ios-profile-scheme
2. Update "Supported Platforms" Build Setting
This is the highest-voted solution from the Flutter community:
- Open
ios/Runner.xcworkspace
in Xcode - Select "Runner" project in left sidebar
- Navigate to Build Settings tab
- Search for "Supported Platforms"
- Change value from
iphoneos
toiOS
// Before:
SUPPORTED_PLATFORMS = iphoneos;
// After:
SUPPORTED_PLATFORMS = ios;
Why this matters:
This setting explicitly tells Xcode to target iOS simulators (iOS
) rather than only physical devices (iphoneos
).
TIP
After making changes, always run:
flutter clean
flutter run
3. Install Latest iOS Simulator Runtime
For Xcode 15+ installations:
- Open Xcode
- Go to Xcode → Settings → Platforms
- Click + next to iOS section
- Download the latest runtime
For older Xcode versions:
Go to:
Window → Devices and Simulators → Simulators → +
Critical Note
The iOS version in your simulator must match at least the minimum deployment target specified in your /ios/Podfile
.
4. Verify and Select Correct Xcode Version
When multiple Xcode versions are installed, ensure you're using the version that supports your simulator:
# Confirm active Xcode:
xcode-select -p
# Switch versions:
sudo xcode-select -s /Applications/Xcode15.app
After changing versions:
flutter clean
pod install --repo-update
Additional Fixes
5. Reset or Recreate Runner Scheme
For corrupted scheme configurations:
- Open
Runner.xcworkspace
- Product → Scheme → Manage Schemes
- Delete existing Runner scheme
- Click + to create new "Runner" scheme (check "Shared" box)
6. Reset Simulator Destinations
flutter config --clear-ios-signing-cert
rm -rf ios/Flutter/Flutter.podspec
flutter clean
Environment Verification
After applying fixes, verify your configuration:
flutter doctor -v
[✓] Flutter (Channel stable, 3.10.5)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Connected device (iOS simulator available)
xcrun simctl list | grep Booted # Verify running simulators
Conclusion
The destination specifier error typically resolves through:
- Correcting Build Settings: Especially the Supported Platforms value
- Validating Schemes: Debug mode for simulators, Release for devices
- Updating Components: Latest iOS runtimes and Xcode selections
Most importantly, avoid modifying runner schemes permanently to accommodate physical device runs—use the flutter run --release
command instead when needed. These solutions cover different root causes, so try them in order if your first attempt doesn't resolve the issue.