How can you run Xcode on Windows and develop iOS apps with a Windows PC? The short answer is: you can’t! You’ve got a few alternatives to get around that, however. In this tutorial, we’ll discuss how you can install Xcode on Windows to build iOS apps.
Apr 27, 2015 When making apps for an Apple device (phone, watch, computer) you need to use Xcode. A free piece of software created by Apple that allows you to design and code up apps. Xcode only works on Apple's operating system OS X. So if you have a Mac, then you can run Xcode no problem.
Here’s what we’ll get into:
Let’s get to it!
Xcode for Windows: What & Why
Xcode is the macOS-only software program, called an IDE, that you use to design, develop and publish iOS apps. The Xcode IDE includes Swift, a code editor, Interface Builder, a debugger, documentation, version control, tools to publish your app in the App Store, and much more.
Xcode contains everything you need to build iOS apps, and it only runs on macOS!
That’s when the problems start. You want to make an iOS app with your Windows PC, but you can’t buy a PC or laptop with macOS pre-installed on it. Unlike Windows, Apple doesn’t license its operating system to other computer manufacturers. You can only use macOS on a Mac.
In fact, when you obtain a license to use macOS, which happens when you purchase a Mac computer, you have to agree to only run the operating system on Apple hardware. This effectively limits you to only develop apps on a Mac.
“It’s more fun to be a pirate than to join the navy.”
— Steve Jobs (1983)
But… it’s more fun to be a pirate, than to join the navy, right? Let’s discuss a few alternatives that’ll let you run Xcode on Windows and develop iOS apps on a Windows PC!
Rent a Mac in the Cloud
An even easier way to get your hands on macOS, albeit more expensive, is to rent a Mac “in the Cloud”. You can work with Xcode on Windows with this approach, because you’re essentially connected to a Mac that’s elsewhere.
Here’s how that works:
Services like MacinCloud and MacStadium offer affordable rent-a-Mac products, usually paid on a monthly basis. Prices typically start at $20/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 launch Xcode, and start building your iOS app. That way you’re effectively running Xcode on your Windows PC!
Cloud-based Macs usually come in 3 flavours:
A dedicated Mac is the most convenient, and the most powerful option. A virtual Mac is OK too, but it typically does not perform as well as a physical Mac computer.
Running Xcode via a Mac in the cloud has a drawback: you can’t easily connect your iPhone to Xcode via USB! With Xcode on your local Mac you can run and debug your app on your own iPhone, via the USB/Lightning cable. This obviously won’t work when your Mac is in the cloud…
Don’t worry! There are plenty of solutions for that:
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-spec computers for a fairly high price.
If you don’t want to take your $3.000 MacBook Pro 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 cloud-based Mac.
Do you want to learn how to code iOS apps, but don’t want to invest money in a Mac? Rent a Mac in the cloud for the duration of the iOS development course you’re taking! It’s a great way to bootstrap learning iOS development, and you can always buy your own Mac later.
Learn how to code iOS appsGet started with Xcode and Swift
Ready to get started with iOS development? Learn how to code iOS apps with Xcode and Swift with our immersive iOS development course. Works both on Mac and PC!
Install macOS on Your Windows PC via VirtualBox
The easiest way to run Xcode on Windows is by using a virtual machine (VM).
A virtual machine will create an environment an operating system can run in, as if it’s running on the hardware itself, except it’s running “on top” of your actual hardware and operating system. You can then run Xcode normally, because it essentially runs on macOS on Windows!
This is called virtualization, and it allows you to run Windows on Linux, macOS on Windows, and even Windows on macOS. One of the benefits of virtualization is to run multiple OS side-by-side, which is useful for cross-platform development.
You need 2 things to run macOS on Windows in a VM:
You can obtain a copy of macOS by downloading it from the App Store or by borrowing it from a friend. A great approach is to search for virtual disk images that have macOS pre-installed. You can also find installers from various sources on the internet, or upgrade a pre-existing image to a newer (beta) version of macOS.
Here’s what you do next:
You can read exactly how to in this tutorial. The recommended system specs are: 4-8 GB of RAM, an Intel i5/i7 compatible CPU, and at least 10 GB of free disk space.
Note: Using macOS on non-Apple hardware is against Apple’s End User License Agreement (EULA). (Fun fact: the same EULA prohibits the use of macOS to manufacture missiles or nuclear weapons…)
Build Your Own “Hackintosh” to Run Xcode
The most obvious choice to run Xcode on a Windows PC is perhaps to literally install macOS 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 Apple Music are all closed systems. Apple enthusiasts have always enjoyed the integrated Apple experience.
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 possible because of open hardware. Because of Apple’s closed systems, you’re always bound by the hardware options they give you.
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. Because macOS shall only run on Apple hardware!
Enter the “Hackintosh”.
A Hackintosh is a PC that runs macOS. Just like you can install macOS in a virtual machine, or in the cloud, you can install macOS as the bootable operating system on your PC. Switch it on, and macOS loads.
![]()
You can also create a dual-boot, i.e. a system that both hosts Windows and macOS. 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 macOS on unsupported hardware.
Nevertheless, it’s a good option for running macOS on your custom hardware, and booting macOS 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?
![]()
The days of the Hackintosh are almost over, depending on who you ask. Apple’s newer hardware includes a T2 chip now. Hardware-specific chips are notoriously hard to mimic in non-Apple hardware, which essentially means that, in the future, you may not be able to install or update macOS on a computer that doesn’t have that T2 chip.
Swift for Windows & Linux
Developers who want to learn Swift have 2 alternative approaches to code Swift, next to working with Xcode on Windows. Swift is open source, which means you can essentially run it on any system.
Currently, you can use:
Here’s how you can run Swift code on Linux:
You can also copy the Swift executables to your
$PATH , or add Swift’s folder to $PATH , to use the swift command anywhere on your system.
Here’s how you can run Swift code on Windows:
It appears the Swift for Windows project hasn’t been updated in a while. It’s latest supported version is Swift 4.1., which doesn’t differ that much from Swift 5 in terms of beginner syntax and functionality. Your mileage may vary, though!
You can even run and compile Swift on the $35 Raspberry Pi single-board computer! You can download Swift 5, which has been ported to the ARM CPU architecture, right here. Installing is as easy as pointing your RPi to the swift-arm repo, then do
sudo apt-get install swift5 , and then run the Swift CLI with swift [filename.swift] . Neat!
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 middle ground is covered by tools like PhoneGap, Cordova, Ionic and Appcelerator, that let you build native apps with HTML5 components. The far end includes smaller platforms like React Native that allow you to write native apps with a JavaScript wrapper.
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:
Choose deliberately for a cross-platform tool because it fits your project, not because you think a native platform language is bad. The fact that one option isn’t right, doesn’t immediately make another option better!
If you don’t want to join the proprietary closed Apple universe, don’t forget that many cross-platform tools are operated by equally monopolistic 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. Also, any cross-platform tool will require you to write platform-specific code at one point, especially if you want to code custom features.
Note: You’ll still need to compile your app with Xcode, even if you use cross-platform tools. Most cross-platform tools rely on the command-line tools that are shipped with Xcode, as part of macOS. You’ll also need Xcode to publish your app in the App Store.
Can You Develope Iphone Apps On Mac Virtual Machine FreeGet a Second-Hand Mac
You gotta ask yourself: Why not get a Mac? Perhaps the simplest option to build iOS apps with Xcode, in this tutorial, is purchasing a Mac for iOS development.
If you don’t want to tinker with cross-platform tools, or rent-a-Mac in the cloud, and just want to get started with iOS development: 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 new Mac Mini for around $800.
A better question is perhaps: is a Mac Mini from 2015 fast enough to build apps with? 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 started LearnAppMaking.com with that same trusty ol’ MacBook, and I’ve coded several successful production apps with it until 2018.
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 economy 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 i486 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…
If you buy a second hand Mac, make sure that it supports the latest version of macOS. Xcode and iOS versions are connected to macOS versions, so you want to buy a Mac that supports at least the current ones. You can find the max. latest version of Xcode that your Mac can run, by cross-referencing the min macOS to run in this wiki with Hardware compatibility in this wiki.
Code Swift with a Swift Sandbox
Do you really need Xcode to code apps? Ultimately, yes. But you can definitely learn Swift and code Swift without a Mac or Xcode!
Here, check this out:
func fibonacci(_ i: Int) -> Int {
if i <= 2 { return 1 } else { return fibonacci(i - 1) + fibonacci(i - 2) } } let numbers = Array(1..10).map { fibonacci($0) } print(numbers)
The above code runs in a Swift sandbox. The sandbox sends the Swift code to a webserver, which compiles it and returns the result. It’s the perfect tool to quickly play with some Swift code in your browser!
Swift is an open-source language, and that means you can effectively run it on any hardware.
Need more space for your Swift code? Check out the bigger Swift Sandbox right here!
Learn how to code iOS appsGet started with Xcode and Swift
Ready to get started with iOS development? Learn how to code iOS apps with Xcode and Swift with our immersive iOS development course. Works both on Mac and PC!
Further Reading
You can’t build iOS apps without Xcode, and you need macOS to run Xcode, and a Mac to use macOS. There’s no getting around it, except for these alternatives to run Xcode on Windows:
Awesome. I want to wish you best of luck with building your iOS app on Windows! Here are a few projects and tutorials to consider:
So you want to develop an iOS application for your iPhone or iPad.
Thinking of being the next big app to hit the appstore.
Only one problem, developing applications for the iPhone and iPad require a Mac or more specifically a machine running Mac OS X. It could be you actually own a Mac, you could go and buy yourself an RM1800 Mac Mini, or you could try a hackintosh, although just creating a hackintosh would be a small project in itself.
Now Hackintosh is actually way beyond the scope of this article, so rest assured I’m not asking you to do anything ridiculously technical or suspiciously illegal. (although those are my favorite type of things to do)
If you’re reading this though, chances are you have a windows PC at home, or even Ubuntu, that’s quite standard and sufficient if you wish to develop Android apps, and they rake in money too.
iOS apps however, are a different beast all together and require a Mac OS X device, which is pretty easy to purchase in Malaysia, but they don’t come cheap. You may want to think hard before plunking down an extra 2-3 thousand ringgit just to ‘try’ your hand at app development. Just like you wouldn’t want to buy 3 year subscription to your neighborhood gym only to go 5 times in the first month — and then never again!
Have no fear though, there is a solution for you ‘try’ at a far cheaper price than the 2-3 thousand price tag Apple Devices carry. It’s called MacinCloud (the name itself is clever twist on the Macintosh)
What is MacinCloud?
MacinCloud is an Cloud Computing platform for Mac Devices. Traditionally, you’d get either Windows or Linux machines on the cloud, and you can buy them cheap of Amazon, Softlayer and rackspace. However, if you wanted OS X in the cloud, you’d need Mac Servers, and from my 5 minutes googling only one name consistently crops up — MacinCloud.(que thunderous applause!!)
The concept is ridiculously simple, just like a standard cloud machine on Amazon running windows, you have a cloud machine on Mac in the Cloud running Mac OS X. So once you remote logon to your machine, instead of seeing a Linux command line, or a windows desktop you see a Mac OS X machine. They also pre-load their
My initial post contained the term virtual machine, but Ted Zhuang the Founder and President of MacinCloud reached out to me stating that MacinCloud does not provide virtualization or sandbox technology, instead he pointed that everything you run on MacinCloud is running on 100% genuine Mac Servers. While even if this were true, I’d expect it to be transparent to users and have almost no bearing on your decision to use them, I believe in full disclosure. Plus, Ted asked really nicely ?
With a fast enough connection, like a 10MB or 20MB Unifi line, this could work out quite well, and it has all the benefits of a standard IaaS or SaaS offering.
How about Price?
Well if you’re serious about developing apps long term, buying a machine would be a better solution, however if you just want to ‘test’ the waters, this is undoubtedly one of the better options.
For just USD20, you get 3 hours a day for a whole month. Spend USD49 and get an entire month unlimited access, or you just pluck down USD8 for a daily pass, and all packages come with a free one day pass to get a feel of the service. They have a ton of pricing options you can check out in their website.
Can You Develope Iphone Apps On Mac Virtual Machine Download
Now USD49 (or RM150) rack up pretty quickly to Rm 1800 in a year, that’s roughly the price of the entry level mac mini, but unlike the Mac Mini this one has a few advantages, including:
1) You don’t have to pluck down Rm1800 just to ‘try’ app development
2) The tools for app development are included in the Mac In the Cloud package, not so from your store bought Mac.
3) You can stop anytime (say after 3 months) and keep a lot of your cash.
Can You Develope Iphone Apps On Mac Virtual Machine Windows 10
4) You can program from anywhere with a good enough internet connection, whether it’s at home, in the office or even at your in-laws. This is actually quite good for smaller startups since buying Mac Books for your developers can be pretty costly, buying cheaper netbooks with cloud connectivity would be a better option (until you launch your million dollar app of course!) that allows developers to work from their own homes over the weekend while you slave drive them into submission.
5) Provides a low cost of entry, so startups or just college students wanting to develop apps can do so without any funding in depreciating hardware ?
and the list goes on…
Mac os sierra compatibility. I do hate these 'Cloud' versions. It took ages on the phone to work out how to re-install my dear old Mavericks!Similarly, if I upgrade the OS then I will be forced into the MS Office 365 rent-a-bit system.
Conclusion
Of course from a purely price perspective over the long run the cloud may cost more (it always does), if you’re a web development company wanting to try app development for just one client, or you’re just a college student working on your Final Year Thesis, this could be the way to do. Especially since most college students only work on their Thesis 2 weeks before the deadline ?
Overall, this is a great way to develop iOS apps on Windows or Linux, without the need of a MAC OS X device.
Are they launching an Asian version?
The email from MacinCloud also had the following interesting bit of news:
In return for your contribution, we would like to give you an exclusive tip for your blog readers regarding our service:
We will soon launch our service in Asia and bring our Mac servers online in our Asian data center. Users from Asian countries such as Malaysia, Indonesia and India will experience a great performance boost. Open up software on mac. This will happen in about a month.
Personally I’m excited to hear that they’re launching closer to Malaysian shores and can’t wait for them to do. I’ll also be curious to find out whether they have existing subscriptions from this part of the world.
If you’ve used MacinCloud, I’ll be really happy to hear your feedback and how you found their service.
Link: Mac in the Cloud
Picture Courtesy of : Screenshot of MacinCloud website
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |