你能在 Linux 中运行 Xcode 吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2406151/
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
Can you Run Xcode in Linux?
提问by Mohit Deshpande
Can you run Xcode in Linux? Mac OS X was based on BSD Unix, so is it possible?
你能在 Linux 中运行 Xcode 吗?Mac OS X 基于 BSD Unix,所以有可能吗?
From what I have heard, there is a MonoDevelop plugin that has an iPhone simulator.
据我所知,有一个带有 iPhone 模拟器的 MonoDevelop 插件。
采纳答案by cdespinosa
The low-level toolchain for Xcode (the gcc compiler family, the gdb debugger, etc.) is all open source and common to Unix and Linux platforms. But the IDE--the editor, project management, indexing, navigation, build system, graphical debugger, visual data modeling, SCM system, refactoring, project snapshots, etc.--is a Mac OS X Cocoa application, and is not portable.
Xcode 的低级工具链(gcc 编译器系列、gdb 调试器等)都是开源的,并且在 Unix 和 Linux 平台上是通用的。但是 IDE——编辑器、项目管理、索引、导航、构建系统、图形调试器、可视化数据建模、SCM 系统、重构、项目快照等——是 Mac OS X Cocoa 应用程序,不可移植。
回答by rfunduk
OSX is based on BSD, not Linux. You cannot run Xcode on a Linux machine.
OSX基于 BSD,而不是 Linux。你不能在 Linux 机器上运行 Xcode。
回答by andyvn22
回答by curtisk
Nope, you've heard of MonoTouchwhich is a .NET/mono environment for iPhone development. But you still need a Mac and the official iPhone SDK. And the emulator is the official apple one, this acts as a separate IDE and allows you to not have to code in Objective C, rather you code in c#
不,您听说过MonoTouch,它是用于 iPhone 开发的 .NET/mono 环境。但是你仍然需要一台 Mac 和官方的 iPhone SDK。模拟器是苹果官方的,它作为一个单独的 IDE,允许您不必在 Objective C 中编码,而是在 c# 中编码
It's an interesting project to say the least....
至少可以说这是一个有趣的项目......
EDIT: apparently, you can distribute on the app store now, early on that was a no go....
编辑:显然,您现在可以在应用程序商店上分发,早期这是行不通的....
回答by Ian
If you run VMware Player or Workstation (or maybe VirtualBox, I'm not sure if it supports Mac OS X, but may), and then Mac OS X Server (Client can't legally be virtualized). Of course, in this case you are running XCode on OS X, but your host machine could be linux.
如果您运行 VMware Player 或 Workstation(或者可能是 VirtualBox,我不确定它是否支持 Mac OS X,但可能),然后是 Mac OS X Server(客户端不能合法地虚拟化)。当然,在这种情况下,您在 OS X 上运行 XCode,但您的主机可能是 linux。
回答by Evan Langlois
I really wanted to comment, not answer. But just to be precise, OSX is not based on BSD, it is an evolution of NeXTStep. The NeXTStep OS utilizes the Mach kernel developed by CMU. It was originally designed as a MicroKernel, but due to performance constraints, they eventually decided they needed to include the Unix portion of the API into the kernel itself and so a BSD-compatible "server" (originally intended to process requests for BSD-compatible kernel messages) was moved into the kernel, making it a Monolithic kernel. It may be BSD compatible in the programming API, but it is NOT BSD.
我真的很想评论,而不是回答。但准确地说,OSX 不是基于 BSD,而是 NeXTStep 的演变。NeXTStep OS 采用了 CMU 开发的 Mach 内核。它最初被设计为微内核,但由于性能限制,他们最终决定需要将 API 的 Unix 部分包含到内核本身中,因此是一个兼容 BSD 的“服务器”(最初旨在处理对 BSD 兼容的请求)内核消息)被移入内核,使其成为单片内核。它在编程 API 中可能与 BSD 兼容,但它不是 BSD。
The rest of the OS involved ObjectiveC (under arrangements between Stepstone and Richard Stallman of GNU/GCC) with a GUI based on a technology called "Display Postscript" ... sort of like an X Server, but with postscript commands. OS X changed Display Postscript to Display PDF, and increased the general hardware requirements 1000 fold (NeXT could run in 8-16MB, now you need GB).
操作系统的其余部分涉及 ObjectiveC(在 Stepstone 和 GNU/GCC 的 Richard Stallman 之间安排)和基于称为“Display Postscript”的技术的 GUI ......有点像 X 服务器,但带有 postscript 命令。OS X 将 Display Postscript 更改为 Display PDF,并将一般硬件要求提高了 1000 倍(NeXT 可以在 8-16MB 中运行,现在您需要 GB)。
Due to the close marriage of GCC and Objective C and NeXT, your best bet at running XCode natively under Linux would be to do a port (if you can get ahold of the source - good luck) utilizing the GNUStep libraries. Originally designed for NextStep and then OpenStep compatibility, I've heard they are now more-or-less Cocoa compatible, but I've not played with any of it in almost 2 decades. Of course that only gets you as far as ObjC, not Swift, and I don't know if Apple is going to OpenSource it.
由于 GCC 和 Objective C 和 NeXT 的紧密结合,在 Linux 下本地运行 XCode 的最佳选择是使用 GNUStep 库进行移植(如果你能获得源代码 - 祝你好运)。最初是为 NextStep 和 OpenStep 兼容性设计的,我听说它们现在或多或少与 Cocoa 兼容,但我已经有近 2 年没有玩过它了。当然,这只能让您了解 ObjC,而不是 Swift,我不知道 Apple 是否打算将其开源。
回答by bbozo
Nobody suggested Vagrantyet, so here it is, Vagrant box for OSX
还没有人推荐Vagrant,所以这里是OSX 的 Vagrant box
vagrant init https://vagrant-osx.nyc3.digitaloceanspaces.com/osx-sierra-0.3.1.box
vagrant up
and you have a MACOS virtual machine. But according to Apple's EULA, you still need to run it on MacOS hardware :D But anywhere, here's one to all of you geeks who wiped MacOS and installed Ubuntu :D
你有一个 MACOS 虚拟机。但是根据 Apple 的 EULA,您仍然需要在 MacOS 硬件上运行它 :D 但是在任何地方,这里都有一个给所有擦除 MacOS 并安装 Ubuntu 的极客 :D
Unfortunately, you can't run the editors from inside using SSH X-forwarding
option.
不幸的是,您无法使用 SSHX-forwarding
选项从内部运行编辑器。
回答by Josh Guyette
If you want XCode on another OS, I suggest cloud computing. That way your app is being developed on a Mac and can be submitted to the App Store.
如果你想在另一个操作系统上使用 XCode,我建议云计算。这样你的 app 就可以在 Mac 上开发,并且可以提交到 App Store。
回答by Roman Kagan
If you cannot shell out thousands of dollars for a decent Mac then there is an option to run OSX and XCode in the cloud:
如果您无法为一台像样的 Mac 支付数千美元,那么可以选择在云中运行 OSX 和 XCode:
回答by Hedron Dantas
The easiest option to do that is running a VM with a OSX copy.
最简单的选择是运行带有 OSX 副本的虚拟机。