No Hack No Life

ライフハック情報をはじめとして、どこかでだれかのタメになる情報を発信していきたいと思っています。

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. と出た時の対処

作業用のmacでgit実行しようとしたらエラーがでた。

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

Xcodeのライセンスに同意しろとかそんな感じみたいですね。

わたくし、英語苦手なのですぐGoogle先生に聞いちゃいます。

f:id:AquaNote:20141122160437p:plain

さすがグーグル先生!ニュアンスだけは伝わってきます。

では、Xcodeのライセンスに同意しましょう。

方法1 Xcodeを起動してライセンスに同意する(最速かつ簡単)

Xcodeを起動するとなにやら表示されますので「Agree」を選択します。

f:id:AquaNote:20141122161031p:plain

敢えてコマンドライン上で解決(マニア向け)

ターミナル系アプリ(ターミナルやiTerm2など)を起動して以下を実行します。

$ sudo xcrun cc

実行すると以下の物がごちゃごちゃと表示され、
同意するなら「agree」と入力してくだされとのことなので
はいはい。とagreeと入力しエンターを押します。

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'

IMPORTANT: BY USING THIS SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE FOLLOWING APPLE TERMS:

A. MAC SDK AND XCODE AGREEMENT
B. iOS SDK AGREEMENT

APPLE INC.
MAC SDK AND XCODE AGREEMENT

PLEASE READ THIS MAC SDK AND XCODE AGREEMENT ("LICENSE") CAREFULLY BEFORE USING THE DEVELOPER SOFTWARE (DEFINED BELOW). BY USING THE DEVELOPER SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS LICENSE.  IF YOU ARE ACCESSING THE DEVELOPER SOFTWARE ELECTRONICALLY, SIGNIFY YOUR AGREEMENT TO BE BOUND BY THE TERMS OF THIS LICENSE BY CLICKING THE "AGREE " BUTTON.  IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, DO NOT USE THE DEVELOPER SOFTWARE AND CLICK “DISAGREE”.

IMPORTANT NOTE: To the extent that this software may be used to reproduce materials, it is licensed to you only for reproduction of non-copyrighted materials, materials in which you own the copyright, or materials you are authorized or legally permitted to reproduce. If you are uncertain about your right to copy any material, you should contact your legal advisor.

1. General.
A. The Apple software, tools, utilities, sample or example code, documentation, interfaces, content, data, and other materials accompanying this License, whether on disk, print or electronic documentation, in read only memory, or any other media or in any other form, (collectively, the "Developer Software") are licensed, not sold, to you by Apple Inc. ("Apple") for use only under the terms of this License.  Apple and/or Apple’s licensors retain ownership of the Developer Software itself and reserve all rights not expressly granted to you. The terms of this License will govern any software upgrades provided by Apple that replace and/or supplement the original Developer Software, unless such upgrade is accompanied by a separate license in which case the terms of that license will govern.

B. Title and intellectual property rights in and to any content displayed by or accessed through the Developer Software belongs to the respective content owner. Such content may be protected by copyright or other intellectual property laws and treaties, and may be subject to terms of use of the third party providing such content. This License does not grant you any rights to use such content nor does it guarantee that such content will continue to be available to you.

2. Permitted License Uses and Restrictions.
A. License. Subject to the terms and conditions of this License, you are granted a limited, non-exclusive license to use the Developer Software on Apple-branded computers to develop and test application and other software. You may make only as many internal use copies of the Developer Software as reasonably necessary to use the Developer Software as permitted under this License and distribute such copies only to your employees whose job duties require them to so use the Developer Software; provided that you reproduce on each copy of the Developer Software or portion thereof, all copyright or other proprietary notices contained on the original.

B. Other Use Restrictions. The grants set forth in this License do not permit you to, and you agree not to, install, use or run the Developer Software on any non-Apple-branded computer, or to enable others to do so. Except as otherwise expressly permitted by the terms of this License or as otherwise licensed by Apple: (i) only one user may use the Developer Software at a time, and (ii) you may not make the Developer Software available over a network where it could be run or used by multiple computers at the same time. You may not rent, lease, lend, sell, sublicense or otherwise redistribute the Developer Software or exploit any services provided by or through the Developer Software in any unauthorized way.

C. No Reverse Engineering; Limitations. You may not, and you agree not to or to enable others to, copy (except as expressly permitted by this License), decompile, reverse engineer, disassemble, attempt to derive the source code of, decrypt, modify, create derivative works of the Developer Software or any services provided by or through the Developer Software or any part thereof (except as and only to the extent any foregoing restriction is prohibited by applicable law or to the extent as may be permitted by licensing terms governing use of the  Open-Sourced Components or Sample Code).


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

さーてgit動くようになったかなーと確認。

f:id:AquaNote:20141122162347p:plain

動きました〜。無事完了。

しかしまぁXcodeがなぜ影響していたのかがわからない・・・。