Here at Appamatix, a lot of our articles are geared towards casual, even social, app and technology users. But from time to time, there comes a topic that may be of more interest to the… more interested. Wait, there’s got to be a better way to say that. Basically, this is for the people who, while very interested in using apps, are just as interested (if not moreso) in creating apps. Not just creating apps, but creating apps in XCode, the proprietary Mac application for the proprietary Mac coding language that allows users to develop for Apple products. (If this is not you, follow this link to see fun pics of Android eating Apple).
And when I say “Apple Products,” I mean all Apple products: Desktops, laptops, iPads, iPhones, iPods, Apple Watches… everything Apple makes that has an operating system, you can code for using this amazing and completely free software package from Apple. The only drawback is that you can only use it on an OS X device. That means that, natively, it is impossible to run XCode (the app) or work in XCode (the language) on a PC. Fortunately, we have a trick for that.
The reason why Apple computers have worked so well over time is that, unlike Microsoft, they don’t bend over backward to be compatible with every piece of hardware or software in the digital universe. To code or create for Apple, you follow Apple’s rules. If you’re even allowed to. — Douglas Rushkoff
How to Get Xcode for Windows PC
Properly speaking, Xcode is an Integrated Development Environment (IDE), which means that this is the total package: this will not only compile your code, it will allow you to design a graphical user interface (GUI), test your apps, even make the documentation for your app. As I said above, this isn’t just for full on computers, but the much more challenging (and potentially profitable) environments of iOS devices. This tool is the quintessential must have for developing for Apple devices — and not just because it’s a great utility that will help you do everything you need (although it is), but because you literally cannot develop for Apple in any other environment. Okay, that’s not entirely true — technically you could code the entire app using a text editor of your choice. But testing the app gets tricky, and of course you can’t publish at all without Xcode.
The Xcode IDE is really quite elegant. It’s easy to work in and provides a lot of “one stop shopping” for the up and coming coder. And as sleek as everything is, it’s really interesting that the folks at Cupertino have decided to distribute it for free. They’re not charging you an arm and a leg to code apps for their hardware and OS because they know they’ll get a piece of the action when you sell it on the App Store (since, unlike Windows, Apple has maintained a monopoly on digital storefronts.) But it’s also just a good community move, to lower the bar for coding, to get as many unique voices out there on the digital forefront as quickly as possible.
But as magnanimous as Apple is in this decision, that magnanimity has its limits. Specifically, that line is drawn when you decide you want to develop for OS X and/or iOS from a (dun dun DUUUUN)… PC! I mean, you can code for PCs from a Mac, but that vice has no versa. Honestly, I’m not sure how I feel about that. On the one hand, it makes sense to have some limits in place in order to keep your digital ecosystem secure. On the other hand, though, I wonder if this isn’t just another move to make users more and more dependent on Mac. I don’t know; depending on the mood I’m in at the moment, I may give you a completely different answer on this one.
But the long and the short of it is this: if you want to develop for Apple devices from a PC, and use Xcode while you’re doing it, you’re going to need an emulator.
Emulating OS X
Here at Appamatix, we are no stranger to emulators. We have a few go-to emulators in our stable that we recommend intermittently in order to help users install popular apps on devices that weren’t meant to run them. Now, when we’re dealing entirely in mobile apps, I usually tend to favor Android emulators, and thus heavily recommend users to get the Android equivalents of whatever popular app they’re trying to run, for the simple reason that reliable and non-sketchy Android emulators are much more plentiful than reliable and non-sketchy iOS emulators.
And so long as we’re talking entirely about mobile apps, that still holds true. However, whenever we open things up to a more desktop and laptop scene, we have a few more options. It’s much easier to find good emulators out there for OS X than it is for iOS. This has been the case since shortly after Mac switched to Intel processors for their computers back in 2005.
That being said, though, once you start emulating, no matter what your host system, guest system, emulator, and the configurations within the three… no matter what your setup is, you are always asking the software (and sometimes the hardware) to do things it was not designed for. The risk for error, even catastrophic error, is greater. To that end, let me say that what I outline here is what I have overturned in my research and in my own (not entirely extensive) playing around. I make no claims about the stability of your own devices in doing this. Now, I haven’t had any problem, nor have any of my friends that have been doing the same stuff for years, but still, that needs to be said.
There are two really dominant OS X emulators I’m comfortable recommending off hand: VMware and VirtualBox. Now, I could do a lengthy run down of pros vs. cons for both of them, but the main thing you’re probably interested in is this: VMware is paid and VirtualBox is free. If you’re just starting out with Xcode, or you’re just playing around, then by all means — use VirtualBox. But if you’re starting to code professionally, with an aim to publishing on the App Store, then you may want to consider going with the paid VMware. Of the two, I have more experience with VMware (although, admittedly, using it to create a virtual PC on my Mac, and almost never vice versa), but since the open source Virtual Box is available for free, and thus creates less of an impediment to discovery and play, I’ll talk you through that one.
Here is what you will need in order for this to work:
- A powerful computer. Your PC is essentially going to be running two operating systems at the same time, and the guest OS (OS X, in this case) is going to be spending a lot of run time compiling code and testing apps, so you’ll need a fast processor and some decent RAM.
- The OS X installer. This should be at least 10.6 (Snow Leopard), but the more recent OS X version you have, the more luck you’re going to have in coding for the current Apple environment. I would recommend going no later than Yosemite (10.10), as virtualizing El Capitan (10.11) is still being figured out. Of course, the trade off here is that more recent versions of OS X don’t come out on install disks. The physical medium of the DVD-ROM made it a lot easier to virtualize, but you may have noticed (or you may not have, since you’re apparently a PC user) that Mac has phased out optical drives on nearly all of its computers, and is starting to do the same with USB ports. It’s all digital downloads these days. This is easily overcome, though: You can download the file from the Mac App Store on the computer of a friend with a Mac, and then port the file onto a thumb drive (provided the friend’s Mac has a USB drive). Depending on what version you are downloading, you may need to pay for this file. However, Mac OS X installation files usually are much cheaper than Windows’. This makes sense, because the OS shouldn’t be the big ticket item — it should be the thing that enables access to other, bigger ticket items.
- Xcode for the specific version of OS X you’re working with. Once again, you may need to use the intercession of a friend’s Mac and a thumb drive for this, but I prefer to download this directly onto my virtual device from the App Store. It’s a great way to make sure everything is installed and configured correctly.
- An AppleID/Apple Account. There’s really no getting around this. Even when I virtualize an Android device, I still need to have a Google Play account to do it. Nevermind the fact that you’re going to need this account anyway, when you try to publish to the app store, so you might as well get this out of the way now.
- Of course, you will need VirtualBox. With system emulation, you can learn to bypass the need for a lot of things. Unfortunately, the emulator is not one of them.
Now that you’ve got all that (and a bag of chips), here’s what you do:
- Install VirtualBox on your PC and install Mac OS X onto that virtual device. Here’s the method I used for this, and I can’t find anything that puts it better. This uses Yosemite which, as I said earlier, is about as late as you can get before you start running into problems.
- Once that is taken care of, installing Xcode is a cinch, just as installing Mac software usually is relatively problem free. Just download the installer from the App Store and run it when the download completes.
- This is a big file, so don’t expect the download and install to go quickly. I’m not saying you can binge the entire first season of Jessica Jones while it’s downloading, but you could probably watch an episode or two. Then you’ll end up bingeing anyway.
That’s it. You now should have everything you need to develop OS X and iOS apps from your PC. Bear in mind that you may not be able to publish these apps to the App Store except from an actual Apple device, but that’s easily overcome with a willing friend.
If any of you have any experience with developing in Xcode, either on a PC or not, please feel free to share your experiences in the comments. Let us know what configurations have worked for you. Or, feel free to ask any questions you may have about what we’ve covered.