Help us understand the problem. What is going on with this article?

gitコマンド実行時にライセンス同意(Xcode/iOS)を要求された場合の対処法

概要

個人的メモ。
gitコマンドを叩いた時にXcode/iOS関連のライセンスに同意するよう言われたので対応した。
※実行環境はMacOS Mojave

事象

$ git status

Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.

こんな感じでライセンスに同意してねと言われる。

対応手順

xcodebuildコマンドを実行

$ sudo xcodebuild -license

Enter押下でライセンス情報を表示

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'

ライセンス情報を確認する

Xcode and Apple SDKs Agreement

PLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS 

〜〜

Software License Agreements Press 'space' for more, or 'q' to quit

SpaceかEnter押下で読み進める。
q押下だとライセンス情報を閉じてしまうので注意。

ライセンスに同意する

ライセンス情報を最後まで表示すると確認メッセージが表示される。
agreeを入力し、Enter押下。

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] 

同意が完了すると以下のメッセージが表示される。

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

動作確認

$ git status

正常にコマンド実行できたら、全行程完了。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした