0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Xcode】シュミレーターが見つからないエラー「Unable to find a destination matching the provided destination specifier」の解決法

Last updated at Posted at 2025-04-23

✅ 背景

FlutterアプリをiOSシミュレータで実行しようとしたら、こんなエラーに遭遇:

Unable to find a destination matching the provided destination specifier:
{ id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX }

flutter run してもシミュレータが見つからず、ビルドに失敗。もちろんsimulatorアプリではシュミレーターは起動している。
xcrun simctl list ではシミュレータが Booted 状態になっているのに、Flutterはそれを見つけられない。
ChatGPTに聞いても解決せず、色々調べて解決したのでChatGPTに記事を書かせることでメモする。


🔍 原因

Xcodeのビルド設定において、Release構成(またはProfile構成)の Supported Platformsiphoneos に設定されていたことが原因。

  • iphoneos実機用
  • iOSシミュレータ&実機両対応

Flutterは、デバッグ時でも一部 Release 設定を参照するケースがあり、これがターゲットの不一致エラーを招いていた。


🛠 解決方法

1. Xcodeでプロジェクトを開く

open ios/Runner.xcworkspace

2. Build Settings を開く

  • 左側で「Runner」ターゲットを選択
  • 中央タブで「Build Settings」をクリック
  • 「All」「Levels」を選択
  • 右上の検索バーで Supported Platforms を検索

3. 各ビルド構成で Supported Platforms を以下に設定:

Screenshot 2025-04-23 at 23.32.47.png

Configuration 正しい値
Debug iOS
Profile iOS ✅ ← ここが iphoneos だとNG
Release iOS ✅ ← ここが iphoneos だとNG

💡 値が見つからない場合は「+」ボタンで SUPPORTED_PLATFORMS を手動追加も可能。


🧼 変更後に実行すべきコマンド

flutter clean
flutter pub get
flutter run

またはシミュレータUUIDを指定する場合:

flutter run -d <シミュレータのUUID>

UUIDは xcrun simctl list devices で確認。


🎉 結果

無事にFlutterアプリがiOSシミュレータ上で起動!


🔚 おまけ:この問題に気づきにくい理由

  • Debug 構成だけ見ても、実は Release の設定がビルド時に影響するケースがある(Flutter特有)
  • Flutterは自動的に最後に使ったシミュレータIDを再利用しようとする
  • SUPPORTED_PLATFORMS はXcodeのバージョンによって見え方が変わる(Xcode 14以降で顕著)

📝 おわりに

Xcodeはちょいちょいこういうエラーに遭遇するので厄介だが、しぶとく頑張っていくしかないかあ。
ChatGPT記事執筆ありがとう。

記事執筆

全てChatGPTであることをご承知おきください。


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?