LoginSignup
2
3

More than 5 years have passed since last update.

【Mac】【Git】OSをmacOS Sierra、XcodeをXcode8にバージョンアップした際に起こる事象と解決方法

Last updated at Posted at 2017-01-02

MacのアップデートとXcodeのアップデートを行った際に
Git周りで発生した事象について纏めました。

事象

gitコマンドを実行した際に以下のメッセージが出力し、
gitコマンドが実行出来ませんでした。

$ git branch

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

メッセージ内容

Xcode のライセンスに同意をする必要がある。
(意訳です...)

対応

1.ターミナル上で「sudo xcrun cc」と実行し、ライセンスに同意する旨のメッセージを出力させる

ターミナル上で「sudo xcrun cc」と実行します。
そうするとライセンスに同意する旨のメッセージが出力されます。


$ sudo xcrun cc

You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'

Apple Inc.

Xcode and Apple SDKs Agreement

その後は、

以下のメッセージが表示されるまでspaceキーを押し続けます。


By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]

2.ターミナル上で「agree」と入力し、出力が完了することを確認する

手順1を最後まで行うと以下のメッセージが出力されているかと思います。


By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]

その状態のままターミナル上で「agree」と入力します。

以下のメッセージが出力すれば成功です。

You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf

上記を実行するとgitコマンドが以前同様に使えるようになります。

$ git branch
* master
  test
  update_readme
2
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
2
3