LoginSignup
5
3

More than 5 years have passed since last update.

[Xcode] "xcrun: error: SDK "iphonesimulator" cannot be located"の解消法

Last updated at Posted at 2018-09-04

概要

xcrunでiPhoneSimulatorが見つからない、エラーが出た時の解消法を紹介します。

$ xcrun -sdk iphonesimulator --show-sdk-path
xcrun: error: SDK "iphonesimulator" cannot be located
xcrun: error: SDK "iphonesimulator" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphonesimulator'

解消手順

以下のコマンドを実行して現状確認をする。

$ xcode-select --print-path
/Applications/Xcode.app  >> このようになっているべき

上記のコマンドを実行して"/Applications/Xcode.app"が返ってこない場合は以下のコマンドを実行してPathを修正する。返ってくる場合はスキップしてください。

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

以下のようにiPhoneSimulatorが見つかればOK。

$ xcrun -sdk iphonesimulator --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk

もし見つからない場合はXcodeを開いてSimulatorをインストールしてください。

Xcode > Preferences > Components から最新のiOSシミュレーターをインストールすれば解消すると思います。

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