加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何以自动化方式接受Xcode许可?

发布时间:2020-12-14 19:45:38 所属栏目:百科 来源:网络整理
导读:为了在CLI中接受 Xcode许可证,我们可以运行 sudo xcodebuild -license 然后控制台会提示 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 li
为了在CLI中接受 Xcode许可证,我们可以运行

sudo xcodebuild -license

然后控制台会提示

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
‘/opt/homebrew-cask/Caskroom/xcode/7.1/Xcode.app/Contents/Resources/English.lproj/License.rtf’

按Enter键,屏幕将显示许可证,并在屏幕底部显示提示

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

通过按q,我们可以快速将许可标记为已读,然后显示最终提示

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]

通过同意,许可证最终被接受.

但整个过程需要人的互动,有没有办法自动接受许可?

我尝试了以下命令,没有一个工作.

sudo echo -e "nqnagreen" | sudo xcodebuild -license

sudo echo -e "agree" | sudo xcodebuild -license

解决方法

它需要管理员权限才能执行此操作(因此使用sudo或以root身份运行),但命令xcodebuild -license accept在Xcode 7.1上为我工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读