xcodebuild 命令工具,无需安装 Xcode 本身

发布于 2024-12-20 12:07:54 字数 280 浏览 1 评论 0原文

我需要在不会进行任何开发的机器上以自动化流程构建 Xcode 项目。我还想节省该机器上的磁盘空间。

我认为 xcodebuild 命令行非常适合此目的。但要安装该工具,您需要安装 Xcode 本身。有没有办法只安装 xcodebuild 和其他依赖项?

我尝试安装这个包,它确实包含xcodebuild,但其他依赖项似乎缺失。

I need to build a Xcode project in an automated process on a machine that will not be making any development. I also want to save disk space on that machine.

I thought the xcodebuild command line would be perfect for that. But to install that tool, you need to install Xcode itself. Is there a way to install only xcodebuild and other dependencies?

I tried to install this package, it does include xcodebuild, but other dependencies seems missing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝梦月影 2024-12-27 12:07:54

现在 Apple 只安装了 CLI,这可能是最好的方法。

下面是旧答案。


您需要丢失一些文件。

  • 安装 这个 以安装 GCC 和 LLVM
  • 从现有 Xcode 安装或安装程序复制这些文件:
    • /Developer/Library/ 中的所有内容
    • 所有内容都在 /Developer/usr/
    • 您需要的平台(iOS 或 MacOSX)位于 /Developer/Platforms/
    • 您在 /Developer/SDKs/ 中构建的 SDK

就是这样!享受极简的 Xcode 安装吧。

Now that Apple has a CLI only install, that's probably the best way to go.

Old answer below.


You need some files missing.

  • Install this to install GCC and LLVM
  • Copy these files from an existing Xcode installation or from the installer :
    • Everything in /Developer/Library/
    • Everything in /Developer/usr/
    • The platform you need (iOS or MacOSX) in /Developer/Platforms/
    • The SDK your building against in /Developer/SDKs/

That's it! Enjoy your minimalist Xcode install.

掌心的温暖 2024-12-27 12:07:54

不要按照 @gcamp 建议安装 osx-gcc-installer。

我这样做了,它损坏了我的系统文件,以至于我不得不重新安装 OSX。

这是完全卸载 osx-gcc-installer 并恢复系统文件的方法:
http://magnemg.tumblr.com/ post/113251602430/how-to-completely-uninstall-osx-gcc-installer

您可能需要安装 Xcode (当我不得不升级到 Qt 5 时,我就这么做了,因为它对 Xcode 具有很强的依赖性。没有办法解决这个问题。)。或者您可能很幸运,只需安装官方 Apple CLT 即可:

Apple 现在提供官方的 Xcode 命令行工具包
您无需安装 Xcode 即可安装!你可以
Apple 开发者网站下载(需要免费注册)
并搜索“命令行工具”。

参见:
https://stackoverflow.com/a/20671590/380607 其中表示:

看来 OSX 已经更改了 xcodebuild,要求 XCode 是
已安装,之前仅在 OSX 上正常运行
已安装命令行工具。

Do NOT install osx-gcc-installer as @gcamp suggested.

I did, and it corrupted my system files to an extent that I had to reinstall OSX.

This is how you uninstall osx-gcc-installer completely, and restore your system files:
http://magnemg.tumblr.com/post/113251602430/how-to-completely-uninstall-osx-gcc-installer

You probably need to install Xcode (I did, when having to upgrade to Qt 5, which had a hard dependency on Xcode. There was no way around it.). Or you might be lucky and can get away with just installing the official Apple CLT:

Apple now provides an official Command Line Tools for Xcode package
that you can install without needing to install Xcode itself! You can
download it from Apple's developer site (free registration required)
and search for "Command Line Tools".

See also:
https://stackoverflow.com/a/20671590/380607 which says:

It appears that OSX has changed xcodebuild to require XCode to be
installed, where before it functioned properly with only the OSX
Command Line Tools installed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文