So you love using a Linux machine but you want to develop iOS apps. It’s not super straight-forward since Xcode only runs on MacOS computers. I dug into this topic and will share with you how to do it yourself.
How To Make iOS Apps on Linux?
Virtual machines are created using software, this enables you to run a MacOS inside your Linux OS. There are a couple of different vendors that you can choose from:
I’d recommend VirtualBox, it’s used in many large tech companies and I’ve personally used it both for my own projects and professionally on the job. The installation process is super simple and getting it running MacOS is a breeze.
You’ll need to either find a MacOS image by searching for one online or by borrowing a friends laptop. Once you have that, you’ll be able to set up your virtual machine – adjusting settings such as hard drive space and memory to your liking.
Once you are inside your virtual machine, it should work almost exactly as if you owned a Mac. You’ll be able to install and run Xcode. Installing iPhone and iPad simulators will work as well. Sometimes the virtual ports may require minimal configuration in order for you to test on a real iOS device, however I have tried it and it works.
This is option is a great solution if you don’t mind a little bit of up front work to set it up. When it’s all been setup, its simple to turn on and off your MacOS when you need it for development!
Renting a Mac online is a hassle-free solution. Companies run a bunch of Macs in the cloud and charge users for access to them. Plans are usually very affordable and can range as low as $20/month.
This is a great way to see if you’re truly interested in iOS development before jumping in. Most of these companies have no contracts and you can cancel at anytime. Here are some companies that offer this product:
One of the downsides of renting a Mac in the cloud is that you won’t be able to test on a physical iOS device. You’ll have to rely on using the simulator. However, when you’re ready to test out your application before releasing to the app store, you can always install Apple’s TestFlight software to see how your app looks on a real device.
A huge benefit of a cloud development environment is being able to access it from anywhere in the world. You can access it from a carribean island or anywhere else you have an internet connection. All your settings will be saved in the cloud.
You could also install MacOS on your Linux machine. This is called dual booting, where your machine has two operating systems that it can start up from. This requires some technical work and not all computer hardware will be compatible will MacOS.
Here are some sites to get you started on created a dual boot – also known as a Hackintosh machine:
Honestly, it’s quite a bit of effort to setup a hackintosh and its hard to keep it up to date. Hardware incompatibility is troublesome to debug and can take a lot of time.
If you’re looking just to build iOS apps, I recommend a different method. If you’re super interested in building custom computers though, this may be a good option for you!
Get started with an online Swift Sandbox Online swift sandboxes are a quick way to get started writing iOS code. There are a couple different options online:
These sandboxes allow you to get started immediately, no Xcode or any other installation of software is required.
You won’t be able to build a full iOS app from these online sandboxes, but you will be able to jumpstart your learning. This is a good option if you’re looking to get your feet wet in Swift code.
It’s also the easiest option and requires the least amount of work! Just click one of the links below and you can begin writing and compiling Swift code immediately.
Third party cross platform solutions have grown a lot recently. Larger companies have started to develop open source libraries to allow developers to code iOS and Android apps in different languages. Here are some of your options:
The hottest ones on the market right now are React Native and Flutter. React native is maintained by Facebook and Flutter is maintained by Google.
These libraries offer many benefits including coding in your favorite language and being able to learn both iOS and Android development at the same time.
However there are some draw backs. For most of these libraries, you still won’t be able to install on iOS device or simulator without a Mac machine. You can still develop the app and then later test it using Apple’s TestFlight. During development though you may just have to stick to the Android simulator. This will be similar, but the exact same as an iOS simulator.
These frameworks will also always be behind the native development path of using Xcode. This is because when Apple releases new features for iOS, they won’t make it onto this framework until weeks or even months later. It’s not an issue for most developers, but if you want to use the latest and greatest features when Apple releases them every year, you may want to look at a different solution.
This is the simplest solution. Buying a cheap MacOS computer will simplify your development greatly. This will eliminate an entire group of bugs from your development environment.
You can develop using almost any MacOS machine. Mac minis, which are Apple’s cheapest MacOS product, will work just fine. Even a Mac mini from a couple years back will work great.
Apple offers refurbished units on their website and you can also check eBay and other sites for deals too.
This will be a good investment if you’re looking to take iOS development as your career or as a serious hobby.
If I have about ~$200-300, I would just buy a refurbished or used Mac mini. This is simplest and will save me a lot of time.
If I am not sure about this whole iOS programming thing, I would rent a Mac from the cloud for a month to test it out. That way I can just cancel later on and just be out $20.
If I have no money at all, I would look into setting up a virtual machine on my Linux computer.
If I have no money at all and no computer, I would try it out in the Apple store. Apple employees don’t care how long you spend in the store, that’s the policy! Where theres a will theres a way 🙂 I’ve heard of people building entire apps from the iMacs at the Apple store.