Build C++ App On Mac Rating: 6,0/10 7970 reviews
  1. C++ On Mac
  2. Install C++ On Mac
Technical Note TN2339

Oct 17, 2019  Install and configure tools to build using iOS.; 10 minutes to read; In this article. You can use Visual Studio with the cross-platform Mobile development with C tools to edit, debug, and deploy iOS code to the iOS Simulator or to an iOS device. But, because of licensing restrictions, the code must be built and run remotely on a Mac. Apr 27, 2019  In this video, I'll show you the steps to build your first iOS application in Visual Studio 2019 with C#,.NET, and Xamarin. We will see how to build a basic app, connection to the macOS host, and dep. I am planning to build a GUI application for Mac and Windows. I've been doing some research in the technology choices, as in the language, libraries, and build tools, so that I can share as much code as possible between the two platforms. The main requirements are: Meets the Mac App Store requirements. Native look and feel on both Mac and Windows. RAD Studio The ultimate IDE with features both C and Delphi developers love: code, debug, test and fast design for cross-platform mobile and desktop deployment.; Delphi Trusted for over 25 years, our modern Delphi is the preferred choice of Object Pascal developers worldwide for creating cool apps across devices.; CBuilder Create and test code once to deploy all the apps with this powerful. Basic C Operators and Control flow where among other things you learn about if clauses and loops. Build an app to guess numbers and put together the concepts learned so far. C Functions. Building your first Qt C GUI Application. Building a GUI Version of your Number guessing game.

This document provides answers to frequently asked questions about command line tools.

What is the Command Line Tools Package?

The Command Line Tools Package is a small self-contained package available for download separately from Xcode and that allows you to do command line development in macOS. It consists of the macOS SDK and command-line tools such as Clang, which are installed in the /Library/Developer/CommandLineTools directory.

Downloading command-line tools is not available in Xcode for macOS 10.9. How can I install them on my machine?

In macOS 10.9 and later, the Downloads pane of Xcode Preferences does not support downloading command-line tools. Use any of the following methods to install command-line tools on your system:

  • Install Xcode

    If Xcode is installed on your machine, then there is no need to install them. Xcode comes bundled with all your command-line tools. macOS 10.9 and later includes shims or wrapper executables. These shims, installed in /usr/bin, can map any tool included in /usr/bin to the corresponding one inside Xcode. xcrun is one of such shims, which allows you to find or run any tool inside Xcode from the command line. Use it to invoke any tool within Xcode from the command line as shown in Listing 1.


    Listing 1 Using xcrun to run dwarfdump in the Terminal application.

  • Download the Command Line Tools package from the Developer website

    The Command Line Tools package is available for download on the Download for Apple Developers page. Log in with your Apple ID, then search and download the Command Line Tools package appropriate for your machine such as macOS 10.12 as shown in Figure 1.

Note: In macOS 10.9 and later, Software update notifies you when new versions of the command-line tools are available for update.

  • Install the Command Line Tools package via the Terminal application

    You can install the Command Line Tools package by running the xcode-select --install command.

    Note: macOS comes bundled with xcode-select, a command-line tool that is installed in /usr/bin. It allows you to manage the active developer directory for Xcode and other BSD development tools. See its man page for more information.

How can I uninstall the command-line tools?

  • Xcode includes all of the command-line tools. If it is installed on your system, remove it to uninstall the command-line tools.

  • If the /Library/Developer/CommandLineTools directory exists on your system, remove it to uninstall the command-line tools.

I have multiple versions of Xcode installed on my machine. What version of Xcode do the command-line tools currently use?

To find out what version of Xcode is being used by your tools, run the following command in Terminal:

Listing 2 Printing the version of Xcode currently used by the command-line tools.

How do I select the default version of Xcode to use for my command-line tools?

C++ On Mac

To select a default Xcode for your command-line tools, run the following command in Terminal:

where <path/to/> is the path to the Xcode.app package you wish to use for development.

Listing 3 Setting the default Xcode version.

How do I build my projects from the command line?

xcodebuild is a command-line tool that allows you to perform build, query, analyze, test, and archive operations on your Xcode projects and workspaces from the command line. It operates on one or more targets contained in your project, or a scheme contained in your project or workspace. xcodebuild provides several options for performing these operations as seen its man page. xcodebuild saves the output of your commands in the locations defined in the Locations preferences pane of your Xcode application, by default.

See below for various xcodebuild usage. Be sure to navigate to the directory containing your project or workspace in Terminal before running any of the following commands.

  • To list all schemes in your workspace, run the following command in Terminal:

    where <your_workspace_name> is the name of your workspace.


    Listing 4 Listing all schemes in the MyApplication workspace.

  • To list all targets, build configurations, and schemes used in your project, run the following command in Terminal:

    Google chrome mac os. Google's free service instantly translates words, phrases, and web pages between English and over 100 other languages.

    where <your_project_name> is the name of your project.


    Listing 5 Listing all information about MyProject, an Xcode project.

  • To build a scheme in your project, run the following command in Terminal:

    where <your_scheme_name> and build are respectively the name of your scheme to be built and the action to be performed on your scheme.


    Listing 6 Building the tvOS scheme.

    Note: xcodebuild supports various build actions such as build, analyze, and archive that can be performed on your target or scheme. However, build is performed by default when no action is specified as shown in Listing 7.

  • To build your target with a configuration file, run the following command in Terminal:

    where <your_target_name> and <your_configuration_file> are respectively the name of your target to be built and the name of your configuration file. See Xcode Help's Build configuration file reference for more information about xcconfig files.


    Listing 7 Building the iOS target with a configuration file.

  • To change the output locations of your xcodebuild command, use the SYMROOT (Build Products Path) and DSTROOT (Installation Build Products Location) build settings that respectively specify a location for your debug products and .dSYM files and one for your released products. See Xcode Help's Build setting reference for more information about these build settings.


    Listing 8 Setting up a location for iOS' debug app version.


    Listing 9 Setting up a location for iOS's released app version.

My app has multiple build configurations. How do I set a default build configuration for xcodebuild?

In Xcode, the Configurations section of your project's Info pane provides a pop-up menu, which sets the default configuration to be used by xcodebuild when building a target. Use this pop-up menu to select a default build configuration for xcodebuild as seen in Figure 2.

How do I run unit tests from the command line?

xcodebuild provides several options for running unit tests.

To build and run unit tests from the command line, execute the following command in Terminal:

To build unit tests without running them from the command line, execute the following command in Terminal:

To run unit tests without building them from the command line, execute any of the following command in Terminal:

The test action requires specifying a scheme and a destination. See How do I implement the Build For Testing and Test Without Building features from the command line? for more information about build-for-testing and test-without-building actions. Free video editing software no watermark for mac software.

The -workspace option allows you to specify the name of your workspace. Use this option when your scheme is contained in an Xcode workspace.

The -project option allows you to specify the name of your Xcode project. Use this option when your scheme is contained in an Xcode project. It is required when there are multiple Xcode projects in the same directory and optional, otherwise.

The -destination option allows you to specify a destination for your unit tests. It takes an argument <destination-specifier>, which describes the device, simulator, or Mac to use as a destination. It consists of a set of comma-separated key=value pairs, which are dependent upon the the device, simulator, or Mac being used.

The -only-testing and -skip-testing options, which are optional, allow you to run only a specific test and to skip a test, respectively. They take an argument <test-identifier>, which specifies the test to be executed or excluded. test-identifier's format is as follows:

TestTarget, which is required, is the name of the test bundle. TestClass and TestMethod, which are both optional, respectively represent the name of the class and the name of the method to be tested.

Note: See Xcode Scheme and Run your app in Simulator for more information about scheme and destination, respectively.

  • For macOS apps, destinationspecifier supports the platform and arch keys as seen in Table 1. Both keys are required for running your unit tests in macOS.

    Table 1 Supported keys for macOS apps.

    Key

    Description

    Value

    platform

    The supported destination for your unit tests.

    macOS

    arch

    The architecture to use to run your unit tests.

    i386 or x86_64

    See Listing 10 for an example that tests a scheme in macOS and where destinationspecifier is set to 'platform=macOS,arch=x86_64'.


    Listing 10 Tests the macOS scheme for 64-bit in macOS.

  • For iOS and tvOS apps, destinationspecifier supports the platform, name, and id keys as seen in Table 2.

    Table 2 Supported keys for iOS and tvOS apps.

    Key

    Description

    Value

    platform

    The supported destination for your unit tests.

    iOS (for iOS apps)tvOS (for tvOS apps)

    name

    The full name of your device to be used for your unit tests.

    The name of your device as displayed in the Devices Organizer in Xcode.

    id

    The identifier of your device to be used for your unit tests.

    See Locate a device identifier for more information about getting your device identifier.

    The name and id keys are intergeably used with platform, which is a required key as seen in Listing 11 and Listing 12.


    Listing 11 Tests the iOS scheme on a device identified by 965058a1c30d845d0dcec81cd6b908650a0d701c.


    Listing 12 Testing the iOSApp scheme on an iPhone.


    Listing 13 Do not test iOSAppUITests on an iPhone.


    Listing 14 Only testing SecondTestClass' testExampleB in the iOSAppTests unit test.

  • For iOS Simulator and tvOS Simulator apps, destinationspecifier supports the platform, name, id, and OS keys as seen in Table 3.

    Table 3 Supported keys for iOS Simulator and tvOS Simulator apps.

    Key

    Description

    Value

    platform

    The supported destination for your unit tests.

    iOS Simulator (iOS apps)tvOS Simulator (tvOS apps)

    name

    The full name of the simulator (iOS simulator for iOS apps and tvOS Simulator for tvOS apps) to be used for your unit tests and as displayed in the run destination of your Xcode project.

    The name of your device as displayed in the Devices Organizer in Xcode.

    id

    The identifier of your device to be used for your unit tests.

    See Locate a device identifier for more information about getting your device identifier.

    OS

    The version of iOS or tvOS to simulate such as 9.0 or the string latest to indicate the most recent version of iOS supported by your version of Xcode.

    An iOS version, tvOS version, or latest

    The name and id keys are intergeably used with platform, which is a required key as shown in Listing 15 and Listing 16. The OS key is optional.


    Listing 15 Tests the iOS scheme on an iPad Pro (12.9 inch) with iOS 10.2 in the Simulator.


    Listing 16 Tests the tvOS scheme on an tvOS Simulator identified by D6FA2C2A-E297-406A-AA22-624B4834ACB2.

The -destination option also allows you to run the same unit test on multiple destinations. This is done by adding it multiple times to your xcodebuild test command as demonstrated in Listing 17.

Listing 17 Tests the iOS scheme in both the Simulator and on an iPod touch.

Install C++ On Mac

Note: xcodebuild runs your tests sequentially. For instance In Listing 17, xcodebuild will first test iOS in the Simulator before executing it on the iPod touch.

How do I implement the Build For Testing and Test Without Building features from the command line?

  • xcodebuild provides the build-for-testing action for Xcode's Product > Build For > Testing feature. You must specify a scheme to use it. To use it, execute the following command in Terminal:

    See How do I run unit tests from the command line? for more information about xcodebuild build-for-testing's options.


    Listing 18 Builds tests and associated targets in the tvOS scheme using the tvOS Simulator identified by D6FA2C2A-E297-406A-AA22-624B4834ACB2.

    build-for-testing generates an xctestrun file, which is saved in the derived data folder. See xcodebuild.xctestrun's man page for more information about xctestrun files.

  • xcodebuild provides the test-without-building action for Xcode's Product > Perform Action > Test Without Building feature. test-without-building requires that you specify either a scheme or an xctestrun file.

    • Usage when using a scheme

      See How do I run unit tests from the command line? for more information about xcodebuild test-without-building's options.

      Important: When using a scheme, test-without-building searches for bundles in the build root (SYMROOT). Therefore, be sure to build your target or that your build root includes the bundles to be tested before running this command. See Xcode Help's Build settings reference for more information about SYMROOT.


      Listing 19 Tests the iOSApp scheme on an iPhone SE with iOS 10.1 in the Simulator.

    • Usage when using an xctestrun file

      where <your_xctestrun_name> is the name of the file containing your test run parameters. See xcodebuild.xctestrun' s man page for more information about xctestrun files. See How do I run unit tests from the command line? for more information about the other options.

      Important: When using an xctestrun file, test-without-building searches for bundles at paths specified in the file. Therefore, be sure that the bundles exist at the specified paths before running this command.


      Listing 20 Testing bundles and other parameters specified in iOSApp_iphonesimulator.xctestrun using the iOS Simulator identified by 6DC4A7BA-EA7F-40D6-A327-A0A9DF82F7F6.


      Listing 21 Tests everything but iOSAppUITests specified in iOSApp_iphonesimulator.xctestrun using the iOS Simulator identified by 3D95DF14-E8B7-4A05-B65B-78F381B74B22.

Note:build-for-testing and test-without-building provide support for continuous integration systems.

What keys can I pass to the exportOptionsPlist flag?

To get all available keys for -exportOptionsPlist, run the following command in Terminal:

Listing 22 Fetching all keys supported by -exportOptionsPlist.

See Figure 3 for a sample file that contains some options for the -exportOptionsPlist flag.

Computer

How do I archive and export my app for distribution?

To archive and export your app for distribution, run the following command in Terminal:

where <xcarchivepath> specifies the archive or the path of the archive to be exported, <destinationpath> specifies where to save the exported product, and <path> is the path to the file with a list of options for the -exportOptionsPlist flag.

Listing 23 Exports the iOSApp archive to the Release location with the options saved in the OptionsPlist.plist.


Document Revision History


DateNotes
2017-06-19

Updated the 'How do I run unit tests from the command line?' question.Added the 'How do I implement the Build For Testing and Test Without Building features from the command line?' and 'What keys can I pass to the exportOptionsPlist flag?' questions.

Updated the 'How do I run unit tests from the command line?' question.Added the 'How do I implement the Build For Testing and Test Without Building features from the command line?' and 'What keys can I pass to the exportOptionsPlist flag?' questions.

2014-05-21

New document that provides answers to frequently asked questions about command-line tools.




Copyright © 2017 Apple Inc. All Rights Reserved. Terms of Use Privacy Policy Updated: 2017-06-19

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)

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:

  • 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 atType
MacinCloud$20/monthDedicated, Virtual, Server
MacStadium$79/monthDedicated, Enterprise
virtualmacosx.com$9.75/monthShared (timesharing)
Mac Cloud$49/monthVirtual
FlowPremiumDedicated, Enterprise
HostMyApple$25/monthVirtual, 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!

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:

  1. A copy of macOS, as an installer or virtual disk image file
  2. A virtual machine tool, like VirtualBox (free) or VMware (paid)

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:

  1. Install VirtualBox or VMware
  2. Mount the macOS installer or disk image
  3. Start the VM to launch macOS
  4. Launch Xcode!

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:

  1. Swift 5 on Ubuntu Linux 16.04 and 18.04 via the official images
  2. Swift 4.1 on Windows 10 via the unofficial swiftforwindows.github.io

Here’s how you can run Swift code on Linux:

  1. Download the latest release from swift.org/download
  2. Unzip the .zip in a convenient location
  3. Locate the swift executable in the usr/bin directory
  4. Compile and run a Swift file with swift [filename.swift]

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:

  1. Download the latest release of Swift for Windows from this page
  2. Start the program and point it to your .swift file
  3. Click Run in the program

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:

  • 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.
  • If you’re familiar with web-based development, check out PhoneGap or Ionic. You’ll feel right at home with HTML 5, CSS and JavaScript. Don’t forget: a native app works different than a website…
  • If you’re familiar with JavaScript, or if you’d rather learn to code JavaScript than Swift, check out React Native. With React Native you can code native apps for iOS and Android using a “wrapper”.

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.

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

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:

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

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: