31
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

xcodeインストールのxcodebuildの確認でエラーで対応したログ

Last updated at Posted at 2019-06-28

swiftを勉強するため、xcode(10.2.1)をインストールして、 xcodebuild -version でバージョン確認しようとしても、エラーになってしまう。

$ swift -version
Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin18.2.0
$ xcodebuild -version
error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

この様にswiftのバージョンチェックはOKだったのだが、xcodebuildのバージョンチェックはエラーに。
command line tools instanceと書いてあるので、Command Line Tools for xcodeを入れて解決と思いきや、同じエラーのまま。
以下のコマンドを入れると xcode-selectは生きている模様。

$ xcode-select -p
/Library/Developer/CommandLineTools

ググってみると、どうやらこのパスがいけないらしい?

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

これでどうだ?

$ xcodebuild -version
Xcode 10.2.1
Build version 10E1001

できたー(ふぅ)

31
16
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
31
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?