GameMaker Studio 2 Desktop comes with three export platforms: Windows, macOS and Ubuntu. In this article we give the required steps to get the macOS platform up and running. However, please ensure that your Mac meets GMS2's system requirements before continuing with this guide.
Note that this FAQ assumes you already have an Apple Developer account, but if you are new to Mac development and/or do not have a Developer Account with Apple, then the following link will take you to a tutorial that explains everything related to getting your developer licence and creating certificates, etc... https://www.raywenderlich.com/127936/submit-an-app-part-1
NOTE: As part of your developer agreement with Apple, you agreed to use a real, physical Mac to build and submit your apps. They have the right to terminate your dev account if they find you in breach. Accordingly, GameMaker Studio 2 support is for a physical Mac and we will not offer support to achieve running macOS in a virtual machine. You should own a Mac computer before beginning any macOS development.
To target macOS from the IDE, you use Target Manager, which is located in the top-right of the main GameMaker Studio 2 workspace:
For the macOS target platform you can see that there are two output options:
- VM - This will build your game using interpreted code.
- YYC - This will build you game using compiled native code.
The VM option will build your game and use interpreted code within a special YoYo Runner. The performance of this target is less optimised than YYC, but it is faster to compile and offers the ability to run in debug mode (when using YYC the debugger will not start). The YYC target however, gives a much greater optimisation (and corresponding performance boost) especially with logic-heavy games, but large projects can take some time to compile.
To compile your game using either the VM or YYC, however, you will need to make sure that your PC or Mac is correctly set up. PC users will have the additional step of setting up Device Manager so that GameMaker Studio 2 can communicate correctly with the Mac build machine.
Set Up macOS
Before going any further, and if you haven't already, you will first need to download and install Xcode onto your Mac, which is what GameMaker Studio 2 will use to build your projects. You can get the latest copy of Xcode here: https://developer.apple.com/xcode/
Be aware that due to the nature of Apple's toolchain and AppStore requirements, the version of Xcode required to be able to submit to the AppStore is periodically raised, and typically new major versions of Xcode are locked to only the most recent 2 or 3 versions of macOS. Accordingly, GMS2's "required" version of macOS and Xcode has to match this, which may mean that if you're on an older OS you will need to update or even use a different Mac.
Usually, if you're not building for the AppStore, then you can remain on older versions of Xcode and macOS for a little longer.
Please see our GMS2 Required SDKs FAQ for specifics and the current supported versions of Apple's software.
Set Up Xcode
Once you have downloaded and installed Xcode, you need to link it with your Apple Developer account so that it can use the required certificates to build your projects. For that you need to follow these steps:
- Go to Xcode > Preferences.
- At the top of the window, click the Accounts button.
- In the lower-left corner, click the Add button (+) .
- Choose Add Apple ID from the pop-up menu.
In the dialog that appears, enter your Apple Developer ID and password and then click Sign In. Your different certificates will now be retrieved. Select the Apple ID you just added and then on the right of the window click the Team Name and then the button Show Details. This should show all the different signing identity certificates options that you have:
If you are using GameMaker Studio 2 on a Mac then you can now skip the following and go directly to the section GameMaker Studio 2 Preferences.
If you are using GameMaker Studio 2 on a PC, then you now need to set up your Mac build machine to permit remote login and file sharing to and from your PC. This is done by going to the System Preferences, and then clicking Sharing. Now follow these steps:
- Select the Remote Login checkbox first then the File Sharing checkbox. In File sharing, click Options.
- Select "Share files and folders using SMB."
- Select the checkbox next to the user account that will be used to share files with Windows users, enter the password for that user, then click OK.
- Click Done.
- Open Network preferences (choose View > Network), select your active connection, then click Advanced.
- Click the WINS tab, then enter the workgroup name used by the Windows computer.
- If you don’t know the workgroup name, on the Windows computer open Control Panel > System and Security > System. (Windows computers normally use either WORKGROUP or MSHOME.)
- Click OK, then click Apply.
You can close these windows now, as you are almost ready to start building projects for Mac. However, we still need to set up GameMaker Studio 2 itself.
Set Up Mac Devices
Back to your GameMaker Studio 2 machine, and in Target Manager you can see that there is a section marked Devices. For Mac IDE users you will already have a "Local" device added automatically by GMS2, so you don't need to create a new device unless you actually have other Macs you'd like to target. However, if you're using the Windows IDE you will need to supply at least one Mac device, so click the button with a small "pencil" icon to do this:
Clicking this will open up the macOS Device Manager where you can add one or more macOS machines to target when running and building your projects for the macOS platform. Here you should click the Add New Device button to create a new Device and then fill out the details (below you can see an example of what information is expected):
The top field, Display Name is simply a name that you can give to the device so that it is easy to identify in the devices list. After filling that out you need to give the Host Name - the IP address or Device Name of the Mac system on the network that is to host the game - and the User Name and Password of the Mac user account that will be used for testing/creating your game. To get the IP address of the Mac system you simply have to go to System Preferences then click on the Network icon and you can see the IP address there. If you wish to use an actual name to address the Mac, then this will require you to enable the option on the Mac as part of the network connection settings. Note that you can also change the default path for where GameMaker Studio 2 will install the files required to build your games on the development Mac.
When that is setup, you can then click the Test Connection button, and if you have installed all the required packages and the Mac machine is visible over the network then it should say "Connection Successful!":
Set Up Preferences
Now that you have set up Xcode and (if you are using a PC) prepared your build device you need to perform one final task before you can start to build and test projects, and that is to set up the macOS Preferences. So, open the GameMaker Studio 2 Preferences (from the File menu on Windows and the GameMaker Studio 2 menu on Mac) and under Platform Settings > macOS you need to specify your Team ID, which is what Xcode will use to identify you when selecting which signing certificates to use, etc...
NOTE: You can find your Team ID from the "Membership" section of your Apple Developer Account.
You can now click the "Apply" button, close the preferences and continue on to test a project.
You are now ready to test your project. Regardless of whether you are on a PC or a Mac or whether you are using the VM or YYC output, you can simply click the "Play" button at the top of the IDE and the game will quickly build. If all has gone correctly your project should now run (although with YYC compile times may be longer than for VM).
Note that in the Windows IDE you can also test play your game using the "Debug" option at the top of the IDE. When clicked using the VM output it will run the game on the Mac and start debugger running on your PC at the same time (this may require some extra permissions from the OS). The debugger permits you to see in detail how your game is performing as well as set breakpoints and check for issues or bugs. For more information, see the manual.
When you are ready to publish your macOS app, you will want to compile a final executable package. This is explained in the following article: