如何接受 Xcode 许可?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31384994/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to accept Xcode license?
提问by sarah
I've been searching the web to look for how to accept Xcode in order to use Xcode to recompile a MATLAB Windows file for a MAC but I did not find any relevant answer.
我一直在网上搜索如何接受 Xcode,以便使用 Xcode 为 MAC 重新编译 MATLAB Windows 文件,但我没有找到任何相关的答案。
The error message I get in MATLAB is :
我在 MATLAB 中得到的错误消息是:
Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
Xcode 已安装,但其许可尚未被接受。运行 Xcode 并接受其许可协议。
I have accept its license through the terminal command sudo xcodebuild -license
then -q
then agree but I still get the same error message. I have also accepted the license when first opening the application.
我必须接受通过终端命令其许可证sudo xcodebuild -license
,然后-q
再同意,但我仍然得到同样的错误消息。我在第一次打开应用程序时也接受了许可证。
Do someone know how to solve this problem?
有人知道如何解决这个问题吗?
Xcode : version 6.4 and Matlab R2015a
Xcode:版本 6.4 和 Matlab R2015a
回答by Ronan Boiteau
You can use the following command to directly accept the license:
您可以使用以下命令直接接受许可:
sudo xcodebuild -license accept
回答by zaph
If you are using the command line then go through the entire license by entering spaceuntil you get to the end where you will be presented with:
如果您使用命令行,则输入整个许可证,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]
输入“同意”即表示您同意软件许可协议的条款。输入“打印”以打印它们或其他任何内容以取消,[同意,打印,取消]
type "agree" and return
输入“同意”并 return
Alternatively just launch Xcode by double clicking it's icon and when presented with the license agreement accept it.
或者,只需通过双击它的图标来启动 Xcode,并在出现许可协议时接受它。
Updated for new information:
更新了新信息:
It seems this may be a MATLAB issue. What version of Xcode are you running? Check with MATLAB to see if that is a supported version.
看来这可能是 MATLAB 问题。您正在运行什么版本的 Xcode?与 MATLAB 核对以查看它是否是受支持的版本。
回答by Ekambaram E
Simply type the sudo xcodebuild -license
into the terminal after press q
for quite
then type agree
sudo xcodebuild -license
按下q
完全后,只需在终端中输入agree
Note: Xcode name should be Xocde not like that Xcode 8.2,etc.,
注意:Xcode 名称应该是 Xocde,而不是 Xcode 8.2 等,
回答by Jake
You can also try enabling the command line tools, which should help prevent the license acceptance issue:
您还可以尝试启用命令行工具,这应该有助于防止许可证接受问题:
# Install Command Line Tools
xcode-select --install
# Enable command line tools
sudo xcode-select --switch /Library/Developer/CommandLineTools
回答by LinWamn
What worked for me was deleting the file: Library/Preferences/com.apple.dt.Xcode.plist
and then running 'sudo xcodebuild -license accept'
in the terminal.
对我有用的是删除文件:Library/Preferences/com.apple.dt.Xcode.plist
然后'sudo xcodebuild -license accept'
在终端中运行。
The first Xcode Licence I agreed to was a beta license. Therefore somehow the entries in this file were still named ...beta... what seems to have caused the error. By running 'sudo xcodebuild -license accept'
a new file is created that is compatible with Matlab (provided ur not using a beta Xcode Version).
我同意的第一个 Xcode 许可证是 beta 许可证。因此,不知何故,这个文件中的条目仍然被命名为 ...beta... 似乎是什么导致了错误。通过运行'sudo xcodebuild -license accept'
创建一个与 Matlab 兼容的新文件(前提是你没有使用 beta Xcode 版本)。
I also downloaded the latest Version of the Command Line Tools but I don't know if that would have been necessary.
我还下载了最新版本的命令行工具,但我不知道这是否有必要。
Hope I could help.
希望我能帮上忙。