是否可以在 Linux 上使用 xcodebuild?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11251202/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 07:08:01  来源:igfitidea点击:

Is it possible to use xcodebuild on linux?

linuxxcodecompiler-constructionxcodebuild

提问by Joshua

Say I've got an Xcode project on a linux machine and I want to, like I can do on the Mac, install & use xcodebuildto simply compile the project, not to run it or anything fancy, just simply to compile it to check for errors.

假设我在 linux 机器上有一个 Xcode 项目,我想,就像我在 Mac 上可以做的那样,安装和使用xcodebuild来简单地编译项目,而不是运行它或任何花哨的东西,只是简单地编译它以检查错误。

Is it possible to install xcodebuildon a Linux machine or is it entirely out of the question, if so what are my alternatives?

是否可以安装xcodebuild在 Linux 机器上,或者完全不可能,如果是这样,我的替代方案是什么?

回答by Joshua

You can't use the standard Apple developer tools on Linux, because they're compiled for Mac OS X.

您不能在 Linux 上使用标准的 Apple 开发人员工具,因为它们是为 Mac OS X 编译的。

If you're compiling for iOS, you can, however, build an opensource iOS toolchain for linux and use it for compiling your app. You'll need a jailbroken device to upload the binary, though.

但是,如果您正在为 iOS 进行编译,则可以为 linux 构建一个开源 iOS 工具链并将其用于编译您的应用程序。不过,您需要一个越狱设备来上传二进制文件。

If you're working with a normal OS X application, then, provided you have the necessary libraries and frameworks, you can build the project for Linux using make.

如果您使用的是普通的 OS X 应用程序,那么,只要您有必要的库和框架,您就可以使用 make 为 Linux 构建项目。