Mohit Deshpande
Mohit Deshpande

Reputation: 55227

Can you Run Xcode in Linux?

Can you run Xcode in Linux? Mac OS X was based on BSD Unix, so is it possible?

From what I have heard, there is a MonoDevelop plugin that has an iPhone simulator.

Upvotes: 239

Views: 347344

Answers (16)

praveen shahi
praveen shahi

Reputation: 31

I would suggest KVM. It is going to provide you almost native performance and it is built-in Linux. Go and check it out.

You will feel like you are using Mac only and then install Xcode there you may even choose to directly boot into the OSX GUI instead of Linux one on startup.

Upvotes: 3

bbozo
bbozo

Reputation: 7301

Nobody suggested Vagrant yet, so here it is, Vagrant box for OSX

vagrant init AndrewDryga/vagrant-box-osx --box-version 0.2.1
vagrant up
# editor's notes:
# - this requires virtualbox
# - version 0.3.1 (2016) is down now, so version 0.2.1 (2015)
# - there are notes for building an image one's self at the site

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

Unfortunately, you can't run the editors from inside using SSH X-forwarding option.

Upvotes: 51

CFV
CFV

Reputation: 792

If you are planning to use a Mac VM on Linux, check out Docker-OSX. It provides a simple approach to use pre-built Mac VMs with Docker.

To know more about the legality of running Apple software on non-Apple hardware, read this article: Is Hackintosh, OSX-KVM, or Docker-OSX legal?

Upvotes: 0

JerryIce
JerryIce

Reputation: 1

Maybe you can use Virtual Machine and Qiling framework.

Upvotes: 0

incidious works
incidious works

Reputation: 9

Use quiling framework For more info check at https://github.com/qilingframework/qiling I think it is the best

Upvotes: 0

Francesco Iapicca
Francesco Iapicca

Reputation: 2657

You can run Xcode on Linux NATIVELY using Darling:

Darling is a translation layer that lets you run macOS software on Linux

Once installed you can install Xcode via command-line developer tool following this link.

Upvotes: 19

RK_DUDE02
RK_DUDE02

Reputation: 15

If you really want to use Xcode on linux you could get Virtual Box and install Hackintosh on a VM. Edit: Virtual Box Guest Additions is not supported with MacOS Movaje. You will want to use VMware

https://www.vmware.com/

https://hackintosh.com/

Upvotes: 1

Hedron Dantas
Hedron Dantas

Reputation: 656

The easiest option to do that is running a VM with a OSX copy.

Upvotes: 2

Roman Kagan
Roman Kagan

Reputation: 10626

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:

http://www.macincloud.com/

Upvotes: 9

Nightness
Nightness

Reputation: 166

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.

Upvotes: 0

Evan Langlois
Evan Langlois

Reputation: 4353

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.

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).

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.

Upvotes: 32

Ian
Ian

Reputation: 101

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.

Upvotes: 10

cdespinosa
cdespinosa

Reputation: 20799

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.

Upvotes: 497

rfunduk
rfunduk

Reputation: 30442

OSX is based on BSD, not Linux. You cannot run Xcode on a Linux machine.

Upvotes: -3

curtisk
curtisk

Reputation: 20175

Nope, you've heard of MonoTouch which 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#

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....

Upvotes: 3

andyvn22
andyvn22

Reputation: 14824

I think you need MonoTouch (not free!) for that plugin.

And no, there is no way to run Xcode on Linux.

Sorry for all the bad news. :)

Upvotes: 3

Related Questions