Developing mac apps on windows

Xcode for Windows: Develop iOS Apps on PC

Written by Reinder de Vries on February 28 2020 in App Development

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.

Here’s what we’ll get into:

  • Rent a Mac in the cloud (starting at $20/mo)
  • Run and compile Swift directly on Windows/Linux
  • Learning to code with a Swift Sandbox
  • Build your own “Hackintosh” by installing macOS on a PC
  • Run Xcode on Windows by installing macOS on a virtual machine
  • Develop iOS apps on Windows with cross-platform tools
  • Get your hands on a second-hand Mac (starting at $300)

Xcode for Windows: What & Why

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:

  • Someone connects a bunch of Mac’s to the internet
  • You sign in on one of those Macs via a Remote Desktop Connection (RDP)
  • Done! You can use this Mac from Windows/Linux and build iOS apps

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.

Starting at Type
MacinCloud $20/month Dedicated, Virtual, Server
MacStadium $79/month Dedicated, Enterprise
virtualmacosx.com $9.75/month Shared (timesharing)
Mac Cloud $49/month Virtual
Flow Premium Dedicated, Enterprise
HostMyApple $25/month Virtual, Dedicated

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, 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 Mac, and then instruct the Build Server to compile the app for you.

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:

  • A simple approach is to run your app on iPhone Simulator, right from within Xcode. You can launch iPhone Simulator in Xcode, and debug your app with it. This is perfect for the development phase of your project.
  • An alternative solution are tools like Flexihub, NoMachine and USB Network Gate. They only work with dedicated Mac hardware, and you need to have a dedicated IP address.
  • Install your iOS app on your iPhone via TestFlight, and debug it with a tool like Bugsnag. You can monitor and debug live crashes in your app.

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 apps

Get 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!

Setting up your Mac with Windows 10

Use your current Mac computer to develop apps for Windows.

Run Windows on your Mac and use Visual Studio

Are you ready to start developing Universal Windows apps, but you don’t have a PC handy? That’s okay — you can use your Mac! With popular third-party solutions like Apple Boot Camp, Oracle VirtualBox, VMware Fusion, and Parallels Desktop, you can install WindowsВ 10 and Microsoft Visual Studio on your Apple computer.

NoteВ В You will need a WindowsВ 10 bootable image on disk or USB flash drive. If you are a MSDN Subscriber, you can download the install image from the MSDN Subscriber Downloads center. If you aren’t a subscriber, the installer can be purchased from the Microsoft Store. You can also download it from this location, which is useful if you are already running Windows and wish to upgrade.

Once you have Windows running, you can then install the latest release of Visual Studio from Developer downloads for WindowsВ 10 and start writing apps!

NoteВ В If you plan to use the Visual Studio device emulators, you must install a 64-bit (x64) version of WindowsВ 10 Pro or better. Unfortunately, some older Macs cannot run 64-bit Windows. Please check with Apple if your hardware is compatible on thisApple support page.

Apple Boot Camp

The Boot Camp Assistant app is pre-installed on every recent Mac, and launching it will walk you through the process of installing WindowsВ 10. All you need is a copy of Windows (from the sources listed above) and at least 30 Gb of free disk space. Once installed, you can choose to boot into Mac OSX or Windows 10. For more info, see Apple’s Boot Camp instructions page.

Parallels Desktop

Using Parallels Desktop 11, you can run Windows apps side-by-side with existing Mac applications, including Visual Studio and Cortana. A pro version is available that includes extra features for developers, including improved debugging, and support for Docker and Jenkins. For more info, and a free trial version, see Parallels Desktop.

VMWare Fusion

Fusion 8 from VMWare will let you run Visual Studio right on your Mac desktop. A pro version is available to offer developers some more advanced features such as vSphere support. For more info, and a free trial version, see VMware Fusion.

Oracle VirtualBox

VirtualBox is a free application for running virtual machines on your computer, and it supports running Windows on Mac. It is a no-frills option, but the price is appealing. For more info, see VirtualBox.

XCode on Windows: How to Develop for Mac or iOS on a PC

Would you like to develop software for Mac OS X or iOS? While it’s easy to develop apps for Linux and Windows on any platform, developing software for Mac requires a toolset called XCode, designed and built by Apple specifically for Mac OS X.

XCode is an incredibly powerful piece of software. Not only is it a complete toolset for developing Mac apps; it’s also an interface builder, testing application, and asset management toolkit.

In this simple guide, you’ll learn how to use XCode on Windows – something that’s normally impossible. All you’ll need is a Windows PC, a copy of Mac OS X, an Apple account, and an Internet connection.

Is this your first time using XCode? Learn how to program software for Mac and iOS with our 1 Hour XCode Introduction.

Installing a virtual PC application with Mac OS X

Since XCode only runs on Mac OS X, you’ll need to be able to simulate an installation of Mac OS X on Windows. This is surprisingly easy to do with virtualization software like VMWare or open source alternative VirtualBox.

For the purpose of this guide, we’ll be using VirtualBox. If you use a different virtual computer application, the process is much the same. Since VirtualBox is open source and free to use, it’s worth downloading it if you don’t already have a copy installed.

Have you never used VirtualBox before? Learn how to use this powerful virtual PC application by enrolling in our course, QuickStart! – Virtual Box. In addition to Mac OS X, VirtualBox can also be used to run Linux and other operating systems.

Running a virtual computer is quite a demanding process, and you’ll need to have a fairly powerful PC for it to operate successfully. You’ll also need a PC with hardware similar to that of a standard, Apple-constructed iMac, MacBook, or Mac Pro.

To successfully emulate a Mac using a Windows PC, you’ll need the following:

  • A Dual Core Intel processor
  • At least 2GB of RAM (4GB+ recommended)
  • Hardware Virtualization

Is your PC too weak to emulate a Mac properly? Learn how to build a powerful PC for gaming, app development, and more with our Learn How to Build a Computer course.

You’ll also need an installation disc for Mac OS X. You can purchase this online from the Apple Store or, if you already own a MacBook, iMac, or Mac Pro, you can use the install disc you received with your computer.

Once you’ve installed VirtualBox, open the application and choose to install Mac OS X Server 64 Bit. Provide the virtual computer with at least 2GB of RAM (if you have more than 8GB of RAM, choose 4GB+) and more than 30GB of hard disk space.

VirtualBox will automatically configure the operating system, but you’ll still need to make a few changes manually. Open the Settings menu and carry out the following changes:

  • On the System tab, uncheck Enable EFI
  • On the Processor tab, select at least two CPUs
  • On the Display tab, increase the video memory to at least 128MB

Installing Mac OS X and booting your virtual machine

Finally, you’ll need to download a Hackboot boot loader to install OS X. You can find a Hackboot install file by searching Google – in this case, you’ll need Hackboot 1 and Hackboot 2, as well as your OS X disc, to complete the installation.

Select your Hackboot 1 disc image, and then start the virtual machine. Your virtual machine will boot, and you’ll see an OS X screen. Using the menu at the bottom of the screen, launch the disc drive that contains your OS X installation disc.

From here, you’ll need to follow the installation instructions for Mac OS X. It takes several minutes to install the operating system. Once the process is finished, you’ll need to switch off your virtual machine and change your boot disc.

Reopen VirtualBox and, leaving all of your other settings the same, switch your boot disc from Hackboot 1 to Hackboot 2. You’ll boot into a screen with two icons. Select Mac OS X and press Enter to initiate the Mac OS X boot sequence.

During the Mac OS X configuration sequence, you’ll need to enter your Apple ID. This is necessary for downloading the XCode toolset later, so make sure you enter a valid Apple account when you configure your operating system.

Installing XCode on your Mac OS X virtual machine

Once you’ve configured your Mac OS X virtual machine, installing XCode is relatively easy. Before you install XCode, you’ll want to configure your virtual machine to your preferred resolution and settings using the System Preferences menu.

Is this your first time using Mac OS X? If you’re a PC user, finding your way around in the new interface can be a challenge. Enroll in Using Mac OS X for Windows Users to learn the basics of the OS X interface, from the Dock to features like Spotlight.

From here, installing XCode is simple. Open the App Store application from the dock and type XCode into the search bar. You might need to reenter your account details, or enter them for the first time if you didn’t do so during Mac OS X configuration.

Navigate to the XCode app and click Install Now to download it. If you don’t have an Apple account, you’ll need to create one in order to download the XCode toolset for your virtual machine.

XCode is quite a large application, and downloading it could take anywhere from a minute to several hours, depending on your Internet connection speed. Once your download is finished, open Applications and click XCode to launch the installer.

Once the installation process is complete, you’ll be able to use XCode within your virtual machine to program apps for Mac OS or iOS. You can also download other Mac apps to use on your virtual machine, although they may not run smoothly.

Developing iOS Apps and more using XCode

XCode is an incredibly powerful toolkit for app development. It’s also refreshingly easy to use, especially for developers accustomed to cumbersome and complicated programming software for PC.

Learn more about how to use XCode by reading our iOS programming tutorial. It’s a great overview of the XCode interface, the programming characteristics of iOS, and much more.

Читайте также:  Azure data studio linux
Оцените статью