Please note before you begin this guide that Windows 10 Mobile support from Microsoft stopped entirely in December 2019, so be aware you can only test on a local phone (there is no ability to publish your apps) and new versions of Visual Studio and/or GMS2 may eventually remove all support.
GameMaker Studio 2 Indie subscription and above permits you to test three different UWP export platforms: Windows 10 Desktop, Windows 10 Mobile and Xbox One. In this article we give the required steps to get the UWP target up and running on a Windows 10 Mobile device.
IMPORTANT! This article assumes that you have gone through all the steps outlined in the article Setting Up UWP For Windows 10 Desktop.
Developer Mode On Your Windows 10 Mobile Device
Before you can build and test on a Windows 10 device, you need to have enabled Developer Mode on the device as well as set up the Device Portal. Enabling Developer Mode lets you sideload apps, and also run apps from Visual Studio, which is important as that's what GameMaker Studio 2 will use to build your final UWP package.
To enable Developer Mode on your device, you need to go to Settings, then choose Update & Security and finally For Developers. On this page you will then need to select Developer Mode from the list of options presented:
When you enable Developer Mode, a package of options is installed that includes the Windows Device Portal. The Device Portal is what will enable GameMaker Studio 2 to connect to your device over the local network (you cannot connect through USB).
You need to enable the Device Portal on your device and then enable Remote Diagnostics as well as Authentication, then take note of the IP shown (as highlighted in the image below):
Now, still in the Developer Mode menu, you should go to the section on Device Discovery and enable Make Your Device Visible To USB Connections And Your Local Network.
With that, you are nearly ready to compile a project and test it on your device, but you have one further step to complete before continuing, and that is to "pair" your device with GameMaker Studio 2 so that it can connect securely. This is done by pressing the Pair button on your device and taking note of the 6 digit security key that is shown. We'll need that along with the device IP for the next step...
Setting Up Your Windows 10 Mobile Device In GameMaker
The final stage for setting up the UWP target for Windows 10 Devices requires you to add the test device to your Target Manager. In the Target Manager Window you can see that there is a section marked Devices with a small pencil icon beside it:
Clicking this will open up the UWP Device Manager where you can add one or more UWP devices to target when running and building your projects for the UWP 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 - this is the IP address of the Windows 10 device on the network that is to host the game and, must be suffixed by ":443" to set the port number (the IP should be the one you noted down from the previous steps in the Device Portal). You can leave the User Name and Password sections blank as they are not required, but you must give the PIN number, which is the 6 digit security code that was generated when you "paired" your device in the steps given above for the Device Portal.
Testing And Compiling Your Project
You have now set up a Windows 10 UWP Mobile device and can go ahead and select it (using either the VM or YYC compiler options) and then click the "Play" button at the top of the IDE. This will compile the game and run it on the device.
You are now set for testing your projects locally on your phone. However, as mentioned at the very start of this guide, that is all you can do with Windows 10 Mobile now - unfortunately, you cannot release this to the Windows Store.