xcodebuild command tool without installing Xcode itself

冷暖自知 提交于 2019-12-09 11:19:00

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/8417137/xcodebuild-command-tool-without-installing-xcode-itself

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!