I like to work on macOS but I write code that will run on Ubuntu. For this reason (as far as I know) I have to compile on Ubuntu to get the build errors that are specific to that operating system e.g. use FoundationNetworking for URLRequests on Linux.
So right now I develop my command line tools in Xcode on macOS and use Multipass to emulate a shell instance of Ubuntu and build on that. This works great but I wonder if there is better way to do this.
Is there a way to build for Ubuntu without emulation or to make Xcode use the Multipass emulator to build the app?
I imagine that I could create a build system maybe use CI to do all this but I'm looking for simple ways that I can set up for any new project in seconds and I want to keep the feedback loop as small as possible.