解决pod install无法执行问题

在执行pod install时遇到需要管理员权限的错误,按照步骤进行:首先使用sudo运行命令,然后同意Xcode/iOS的许可协议,通过空格滚动到末尾并输入agree以确认同意。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

2、解决办法:

第一步: 输入下面的命令

<code class="hljs ruby has-numbering" style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal;"><span style="font-size:18px;"><strong>bixiaopeng<span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">@bixiaopengtekiMacBook</span>-<span class="hljs-constant" style="box-sizing: border-box;">Pro</span> <span class="hljs-constant" style="box-sizing: border-box;">SecondApp</span><span class="hljs-variable" style="color: rgb(102, 0, 102); box-sizing: border-box;">$ </span>sudo xcodebuild -license
<span class="hljs-constant" style="box-sizing: border-box;">Password</span><span class="hljs-symbol" style="color: rgb(0, 102, 102); box-sizing: border-box;">:</span></strong></span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; background-color: rgb(238, 238, 238); top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right;"><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>1</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>2</strong></span></li></ul>

第二步: 同意Xcode条款

输入密码后要求你必须同意下面两个Xcode条款.

<code class="hljs livecodeserver has-numbering" style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal;"><span style="font-size:18px;"><strong>You have <span class="hljs-operator" style="box-sizing: border-box;">not</span> agreed <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">to</span> <span class="hljs-operator" style="box-sizing: border-box;">the</span> Xcode license agreements. You must agree <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">to</span> both license agreements below <span class="hljs-operator" style="box-sizing: border-box;">in</span> order <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">to</span> use Xcode.

Hit <span class="hljs-operator" style="box-sizing: border-box;">the</span> Enter key <span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">to</span> view <span class="hljs-operator" style="box-sizing: border-box;">the</span> license agreements <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'</span></strong></span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; background-color: rgb(238, 238, 238); top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right;"><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>1</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>2</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>3</strong></span></li></ul>

按照提示点击Enter键来查看条款.

<code class="hljs oxygene has-numbering" style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal;"><span style="font-size:18px;"><strong>pple Inc.

Xcode <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">and</span> Apple SDKs Agreement

PLEASE SCROLL DOWN <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">AND</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">READ</span> ALL <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">OF</span> THE FOLLOWING TERMS <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">AND</span> CONDITIONS CAREFULLY BEFORE <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">USING</span> THE APPLE SOFTWARE <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">OR</span> APPLE SERVICES.  THIS <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">IS</span> A LEGAL AGREEMENT BETWEEN YOU <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">AND</span> APPLE.  <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">IF</span> YOU AGREE <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">TO</span> BE BOUND <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">BY</span> ALL <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">OF</span> THE TERMS <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">AND</span> CONDITIONS, CLICK THE “AGREE” BUTTON.  <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">BY</span> CLICKING “AGREE” <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">OR</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">BY</span> DOWNLOADING, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">USING</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">OR</span> COPYING ANY PART <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">OF</span> THIS APPLE SOFTWARE <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">OR</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">USING</span> ANY PART <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">OF</span> THE APPLE SERVICES, YOU ARE AGREEING <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">ON</span> YOUR OW
... 巴拉巴拉一大堆...

<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">By</span> typing <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'agree'</span> you are agreeing <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> the terms <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">of</span> the software license agreements. <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">Type</span> <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">'print'</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> print them <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">or</span> anything <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">to</span> cancel, [agree, print, cancel] </strong></span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; background-color: rgb(238, 238, 238); top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right;"><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>1</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>2</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>3</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>4</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>5</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>6</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>7</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>8</strong></span></li></ul>

点击空格看到最后,输入agree来同意条款.

<code class="hljs applescript has-numbering" style="display: block; padding: 0px; background-color: transparent; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace; white-space: pre; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; word-wrap: normal;"><span style="font-size:18px;"><strong>agree

You can view <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">the</span> license agreements <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">in</span> Xcode's About Box, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">or</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">at</span> /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf</strong></span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; background-color: rgb(238, 238, 238); top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right;"><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>1</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>2</strong></span></li><li style="box-sizing: border-box; padding: 0px 5px;"><span style="font-size:18px;"><strong>3</strong></span></li><li style="font-size: 14px;"></li></ul>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值