How To Develop iOS Apps On A Windows PC
How can you develop iOS apps on a Windows PC? The short answer is… you can’t! There are plenty of options to get around that, however. Let’s find out in this article!
The problem is Xcode, the Integrated Development Environment (IDE) you use to design, develop and publish iOS apps. Xcode includes the Swift compiler, Interface Builder, and tools to upload your app to the App Store. Xcode contains everything you need to build iOS apps, and it only runs on Mac OS X.
And that’s where the problems start. You can’t buy any PC or laptop with OS X (now called macOS) on it, because unlike Windows, Apple doesn’t license its operating system to other computer manufacturers. When you obtain a license to use OS X, you have to agree to only run the operating system on Apple hardware. This effectively limits you to only develop apps on a Mac.
But… it’s more fun to be a pirate, than to join the navy, right? So let’s figure out how you can develop iOS apps on a Windows PC!
1. Use VirtualBox and Install macOS on Your Windows PC
The easiest way to develop iOS apps on a Windows PC is by making use of a virtual machine. A virtual machine will create an environment an operating system can run in, as if it’s running on the hardware itself.
This is called virtualization, and it allows you to run Windows on Linux, OS X on Windows, and even Windows on OS X.
To run OS X on a virtual machine, you need two things:
- A copy of OS X, as an installer or virtual image file
- A virtual machine tool, like VirtualBox (free) or VMware (paid)
You can obtain a copy of OS X by downloading it from the App Store or by borrowing it from a friend. You can also find installers from various sources on the internet.
You then install VirtualBox, and “mount” the OS X installer in a new virtual machine. You can read exactly how in this tutorial.
The recommended system specs are: 4-8 GB of RAM, an Intel i5 or i7 compatible CPU, and at least 10 GB of free disk space.
Keep in mind that using macOS on non-Apple hardware is against Apple’s End User License Agreement (EULA). (Fun fact: the same EULA prohibits the use of OS X to manufacture missiles or nuclear weapons…)
Get complementary access to my course, Zero to App Store, and learn how you can build a real-time chat app with Firebase and Swift!
2. Rent a Mac in the Cloud
An even easier way to get your hands on OS X, albeit more expensive, is to rent a Mac in the Cloud.
The idea is simple:
- Someone else has a bunch of Macs, and connects them to the internet
- You sign in on one of those Macs with a Remote Desktop Connection (RDP)
- Done! You can use this Mac from a Windows PC, from anywhere!
Services like MacinCloud, MacStadium and XCLOUD offer affordable rent-a-Mac products, usually paid on a monthly basis. Prices typically range from $50 to $150 a month, and you can choose from several hardware options including Mac Mini and Mac Pro.
You connect to those cloud-based Macs via a Remote Desktop Connection (RDP). Windows includes a stock Remote Desktop Client you can use, and so do most Linux operating systems. Once you’re logged on, you can install Xcode, and start building your app.
Cloud-based Macs usually come in three flavours:
- A dedicated Mac, which means you get access to a physical Mac located in a data center, as if you bought a Mac in the Apple Store and put it on your desk
- A virtual Mac, which means you get access to a virtual Mac in a data center, much like the VirtualBox solution mentioned earlier. Your Mac won’t run on Apple hardware, but it will run macOS.
- A Mac Build Server, which is a specialized kind of Mac that can be used to compile iOS apps. You’ll create those apps on your local PC, and then instruct the Build Server to compile the app for you.
A Mac Build Server is most suitable for enterprise level applications, or for multi-person teams. Build Servers come in handy for Continuous Integration (CI) practices, but it’s not a practical solution if you’re just looking to develop an app on a Windows PC.
Running a Mac in the cloud has one major drawback: you can’t connect your physical iPhone to Xcode. With Xcode, you can run and debug your app directly on your iPhone if you connect it with a USB-to-Lightning cable. Since your Mac is in the cloud, that’s pretty much impossible…
A solution is of course to run your app on iPhone Simulator, right from within Xcode. You can then try out your app and debug it. When you want to run the app on your iPhone, you simply install it via TestFlight. If you install a tool such as Crittercism of Crashlytics, you can even monitor and debug live crashes.
An interesting use case for renting a Mac in the cloud comes from the latest developments in Apple’s hardware. Many designers, developers and desktop-publishers have voiced their concerns over Apple hardware lagging behind, offering low-specs computers for a fairly high price.
If you don’t want to take your $2500 development machine with you in a coffee shop, or on your next trip to Thailand, why not purchase a low-end Windows or Linux laptop, and connect to your Mac in the cloud? You can either host it at home yourself, co-locate it in a data center, or rent a dedicated Mac in the cloud.
Do you want to learn how to code iOS apps, but don’t want to invest in a Mac? Rent a Mac in the cloud for the duration of the iOS development course you’re taking!
3. Build Your Own “Hackintosh”
The most obvious choice to develop iOS apps on a Windows PC is perhaps to literally install OS X on a Windows PC…
“One platform to rule them all” has always been Apple’s take on the world. The Mac, App Store, iOS and even iTunes are all closed systems.
Apple enthusiasts have always enjoyed the integrated Apple experience, product design, and interconnectivity. You don’t go to a fastfood restaurant chain, and order a-la-cart custom toppings, right?
On the other hand, the rest of the world builds computers using an “open systems architecture”, in which you can effectively mix-and-match computer components and architectures to create your preferred computing machine.
Building $10.000 gaming PCs, mid-level desktops, blazing-fast ultrabooks, and $250 laptops is only a possibility because of open hardware.
But… what if you want to run macOS on your custom built PC? Apple won’t let you, and your computer manufacturer can’t install macOS for you, even if they wanted to.
Enter the “Hackintosh”.
A Hackintosh is a PC that runs macOS. Just like you can install OS X in a virtual machine, or in the cloud, you can install OS X as the bootable operating system on your PC. Switch it on, and OS X loads.
You can also create a dual-boot, i.e. a system that both hosts Windows and OS X. When you boot your PC, you can select the operating system that starts.
Building a Hackintosh can be a tricky exercise, especially if you’re not familiar with PC hardware and creating custom installations. Not all hardware is compatible with macOS. Moreover, Apple has of course created safe-guards against booting OS X on unsupported hardware.
Nevertheless, it’s a good option for running OS X on your custom hardware, and booting OS X on your Windows PC. Check out hackintosh.com for more information, and step-by-step guides.
The name “Hackintosh” comes from the old brand-name of Apple computers: Macintosh, combined with “hack”. Again, it’s against Apple’s EULA – but you wanted to be a pirate, right?
4. Develop iOS Apps on Windows With Cross-Platform Tools
Cross-platform tools are awesome: you code your app once, and export it to iOS and Android. That could potentially cut your app development time and cost in half. Several cross-platform tools allow you to develop iOS apps on a Windows PC, or allow you to compile the app if there’s a Mac in your local network.
Well, not so fast…
The cross-platform tool ecosystem is very large. On the one side you have complete Integrated Development Environments (IDEs) like Xamarin, that allow you to build cross-platform apps with C#.
The one thing that stands out for all cross-platform tools is this: they’re not beginner friendly! It’s much easier to get access to a Mac, learn Swift, and build a simple app, than it is to get started with Xamarin.
Most of the cross-platform tools require you to have a basic understanding of programming, compilation options, and the iOS and Android ecosystems. That’s something you don’t really have as a beginner developer!
Having said that, let’s look at a couple of options:
- If you’re familiar with Windows-based development tools and IDEs, and if you already know how to code, it’s worthwhile to check out Xamarin. With Xamarin you code apps in C#, for multiple platforms, using the Mono and MonoTouch frameworks.
Always deliberately choose for cross-platform tools because it’s a smart option, not because you think a native platform language is bad. The fact that one option isn’t right, doesn’t immediately make another option smarter!
If you don’t want to join the proprietary closed Apple universe, don’t forget that many cross-platform tools are operated by equally evil companies like Google, Facebook, Microsoft, Adobe and Amazon.
An often heard argument against cross-platform tools is that they offer limited access to and support for smartphone hardware, and are less “snappy” than their native counterparts. Keep in mind that any cross-platform tool will require you to write platform-specific code at one point, especially if you want to code custom features.
5. Get A Second-Hand Mac
You gotta ask yourself – why not get a Mac? Perhaps the easiest option in this post is simply purchasing a Mac.
If you don’t want to tinker with cross-platform tools, rent-a-Mac in the cloud, and simply want to get started: get a Mac.
A simple search on Ebay shows you 1-3 year old second-hand Mac Mini’s for as little as $250. Any newer, decent second-hand Mac Mini will set you back around $450. Don’t forget that you can get a brand spankin’ new Mac Mini for $500.
A better question is perhaps: is a 2011 4GB Mac Mini fast enough to build apps with?
Well… get a load of this: I’ve built 50+ apps for iOS, Android and the web since 2009, and a fair share of those were built on a 1.2 Ghz 8GB MacBook Air from 2013. I’m currently writing this post on the same MacBook, and I’ve coded several successful production apps with it in the past 12 months.
It’s traveled with me all over the world, from the beaches of Thailand, to airline lounges, to coffee shops, to coding apps with my knees behind my ears, cramped in cattle class at 20.000 feet up in the air.
I don’t want to go all nostalgic on you, but I learned to code on a 100 Mhz i386 PC, when lines still started with a number. That’s a lot faster PC than the one that put man on the moon, at 46 Khz.
So, to say that a Mac Mini, or your new 2015 MacBook Pro, is fast enough, is an understatement…
6. Code with a Swift Sandbox
So… do you really need Xcode to code apps? Ultimately, yes. Before you finish your app, however, you’ve learned to code, and you can do that right here, right now, without Xcode!
Swift is an open-source language, and that means you can effectively run it on any hardware. Therefore, you can also run it in your browser – provided someone has ported the language to Chrome, Safari or Firefox.
A great option exists already: the Swift Sandbox! You can check out one here, and the iOS development course here on LearnAppMaking includes access to our private Swift sandbox. You can use these Swift Sandboxes right in your browser, to code Swift.
Check out this piece of Swift code:
print("I don't need a Mac!")
Copy it, and then open the Swift Sandbox, paste the code and click the run button. What’s the output, on the right?
I don't need a Mac!
Start learning iOS app development with Swift today, with our practical course, which includes step-by-step screencasts, app templates, and everything you need to know to design, build and publish your own iOS apps.
» Learn more
Disclaimer: This article does not include any paid endorsements, nor is the author affiliated with any of the mentioned services.
Most Popular Content
- How To Develop iOS Apps On A Windows PC
- How To: Build A Real-Time Chat App With Firebase And Swift
- How To: Random Numbers in Swift
- Creating A Simple iOS Game With Swift In Xcode (Part 1)
- How To: Pass Data Between View Controllers In Swift (Extended)
- Grand Central Dispatch: Multi-Threading With Swift
- Understanding The “Use of Unresolved Identifier” Error In Xcode