5
2

More than 1 year has passed since last update.

【Flutter】ios simulatorが認識されない場合の対処方法

Posted at

Android Studioでやっても、VScodeでやっても、起動しているios simulatorが認識されない!
Androidの端末は認識されてるのに!
という時は、一度flutter doctorコマンドを実行し、なぜ認識できないのか調べます。

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.1, on macOS 11.6 20G165 darwin-arm, locale
    ja-JP)
[!] Android toolchain - develop for Android devices (Android SDK version
    32.1.0-rc1)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.
[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.63.2)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

自分の場合、このような感じになりました。
どうやら、Xcodeのところの一番下にある、このセットアップを行わないといけないようです。

$sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
$sudo xcodebuild -runFirstLaunch

では、実際にセットアップをしていきます。
まずは、このコードをターミナルで実行します。

$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

その後、このコードをターミナルで実行し、読み進めていき、「agree」を入力したら終了です。

$ sudo xcodebuild -license

これで無事にios simulatorが認識されました。
もし困っている方がいらっしゃいましたら、是非お試しください。
スクリーンショット 2022-02-14 19.51.45.png

5
2
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
5
2