Hacker News new | ask | show | jobs
Ask HN: Why can't I run xcode/iMessage on Linux?
9 points by cjoshmartin 1963 days ago
It is now easier then ever to get a MacOS VM up and running on a linux machine, using something like Simple MacOS Kvm(https://github.com/foxlet/macOS-Simple-KVM).

People have also got MacOS running inside docker containers and on k8: * https://github.com/sickcodes/Docker-OSX * https://www.youtube.com/watch?v=fBELP05oPO4&ab_channel=AltConf

There have been big moves to get windows video games to run well on linux with the help of services like Proton (https://www.protondb.com/) and Lutris (https://lutris.net/). Why not apple services?

I can run apple services easily inside of my MacOS KVM VM, why I can't directly run services imessage or xcode on my linux machine? MacOS could be running headless inside a docker container, and have an interface on the linux side to look at imessage or xcode, right?

4 comments

Yes, you can run Xcode in a VM or emulator running macOS.

The reason you can't run Xcode on Linux directly (i.e. not in an emulator or VM) is that nobody has done the work. The people with the expertise to do it are Apple, and they haven't done so and are unlikely to do so.

Some reasons Apple doesn't provide Xcode for Linux (a la Visual Studio) are that 1) Apple is in the business of selling computers, so they benefit directly from requiring iOS and macOS developers to buy Macs, and 2) Xcode is written for macOS, so it requires a large portion of the macOS ABI and runtime in order to run. Also 3) Apple is in the process of switching from x86 to Apple Silicon. Although there are ARM-based Linux systems, they may not be 100% compatible with Apple's M1 and other chips.

There is little to no business or technical incentive for Apple to do the large amount of work required to either port Xcode to Linux (especially x86 Linux) or to create a virtual macOS environment (analogous to WINE) for running macOS software on Linux. The GNUStep project created a fair amount of the Objective-C/NeXTSTEP environment and enabled some macOS apps to be cross-compiled for Linux, but a great deal of work would be required to create a complete environment capable of either cross-compiling or running Xcode (or other large macOS apps) on Linux.

> MacOS could be running headless inside a docker container,

Linux containers are for native Linux executables, not foreign OS kernels. To run an OS kernel, you need a virtual machine monitor like kvm or virtualbox.

TL;DR: Use virtualization.

> Some reasons Apple doesn't provide Xcode for Linux (a la Visual Studio)

Visual Studio Code is not Visual Studio, and AFAIK the latter cannot run on Linux, not even using WINE.

Socially: Because Apple is a monopolist that wants to force you to buy an Apple computer if you want to develop for iOS or send messages to iPhone users.

Technically: attaching to the iMessage network requires that you use the "trusted platform module" that Apple supplies, and signing code on XCode requires the same.

Just like in the 1990's, the "trusted platform module" is a function of the platform owner not trusting you, not a function of the platform owner not trusting criminals who want to rip you off.

There is no TPM required for either of these, AFAIK. iMessage and code signing both predate the T1/T2/M1, where there was no "TPM".
>Because Apple is a monopolist There's little about Apple's place in the market that makes them a monopoly. Using this word to describe companies that engage in anti-consumer behavior is reductive and unhelpful.
You have to use a mac to develop for iOS. That's pretty unique.

Compare that to Android where you can develop on a large number of platforms, or the many cross-platform tools that can target Windows, MacOS and Linux. Or embedded platforms like Arduino or FPGA where you can download and install the software on many different computers. Back in the day Infocom developed games like Zork on a PDP-11 and published them to home computers. It's a normal thing in the industry unless you're developing for a monopolist.

Similarly iMessage is sneaky and substitutes for SMS -- my sister-and-law noticed this the other day and was suprised. Thus the system shuns and isolates non-iPhone apple users from their friends and shames and intimidates them to switch.

Android is about as much a real competitor for iOS as MacOS was in the late 1990's when Microsoft bought a stake in Apple to keep Apple alive so the antitrust courts wouldn't tear them apart.

Google doesn't make money on Android, Android phone makers don't make a profit despite selling $2400 phones. The real economic value of Android is that it's an atomic bomb pointed at Apple. If Google decided to end Android the way that they end most platforms, the EU would kick Apple out in a heartbeat. So Apple owes a lot to Google (patronage network style) for keeping an unviable OS alive.

There’s no tpm needed for iMessage.
Another reason is that XCode and Messages are rapidly-moving targets.

Even if you develop something with feature-parity, by the time you get there, the puck will have already moved quite a ways.

I felt this is much the same reason why projects like ReactOS and GNUstep, while I consider them great achievements, have not seen mainstream adoption. They achieved great things, but the puck had already moved.

There are many things possible that no one has written software to do yet. I think it mostly comes down to money, market, and difficulty.
I think there would be a market, if people could write ios apps or answer message (like airdroid) on any operating system. But maybe as just an open source project.