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).<p>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<p>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?<p>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?
Yes, you can run Xcode in a VM or emulator running macOS.<p>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.<p>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.<p>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.<p>> MacOS could be running headless inside a docker container,<p>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.<p>TL;DR: Use virtualization.
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.<p>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.<p>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.
Another reason is that XCode and Messages are rapidly-moving targets.<p>Even if you develop something with feature-parity, by the time you get there, the puck will have already moved quite a ways.<p>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.