Before actually starting to work with GameMaker: Studio and Android, it is worth noting that Android devices vary immensely in capability. The GameMaker: Studio runner will only work with Android 2.3 and above, which covers the majority of devices around at the moment but not all of them, so please check and make sure which version of Android your device uses. It is also recommended that your device have a dedicated GPU with Open GL version 1.1 or above. Devices without a GPU will still run your GameMaker: Studio projects, but expect them to have severe drop in performance.
Setting up GameMaker: Studio so that it works easily with Android devices can be a tricky procedure. To that end we have outlined every step in this process so that it can be done as quickly and painlessly as possible.
Android SDK Setup
To start working with your Android devices and GameMaker: Studio you will need to download and install the Android SDK as well as the Android NDK (which is required for the YYC to work). Here we outline the step-by-step process of going about this and getting everything setup correctly.
Install Java JDK
If you do not have the Java SE Development Kit (JDK) installed already, you will need this when installing the Android SDK, so please install this now (you can find which version of the JDK you currently require from the helpdesk page on Version Support).
Install the Android SDK
First you should go to http://developer.android.com/sdk/index.html#Other and download the Android SDK (you can find which version of the SDK you currently require from the helpdesk page on Version Support). Please note: higher up on the SDK download page you may be presented with the option of downloading the ADT Bundle for Windows, but this is not recommended, as it is a pre-prepared development bundle that comes with Eclipse and alternative configuration tools which will not be covered here.
- Run the Android SDK installer. You will be asked to install the Android SDK to the path "C:\Program Files (x86)\Android\android-sdk". We strongly recommend that you choose something with no spaces in the path, such as C:\android-sdk\, as the default path can cause problems with the actual Android updater program itself.
- Once you have successfully installed the Android SDK you will be given the option to start the Android SDK Manager. This you must do, as it will install additional tools and device specific functions. When it starts you should select only Android SDK Tools, Platform-tools, Build-tools, Android Support Repositories and Android Support Libraries as well as the most recent Android API Version (selected automatically by default by the manager). Please don't just select everything to be installed, as this will a) needlessly waste your bandwidth and HDD space, and b) might cause conflict errors during builds.
- Please note that you may need other API's etc if you are utilising certain functionality or are aware of any SDK issues.
- It should be noted that after installing these files the Android Download Manager may inform you that there are other files to be installed and that you should close and relaunch the SDK Manager, so please do this if asked..
- It is advised to check the revision details and see if you don't already have the selected update installed. For more information on this process and the Download Manager See Here.
- You should also set the PATH variable to allow you to run the command line tools (more information here).
Your Android SDK Manager should look something like this:
Install the Android NDK
You should proceed to download the Android NDK as well, and you can find which version of the NDK you currently require from the helpdesk page on Version Support. Note that later versions of the NDK ship with 32bit and 64bit "platform target" versions, so it's important that you install the correct package.
The installation is simple - a straightforward unpacking operation to a single location - and again, we would recommend you modify the install location to be a simple path such as "C:\android-ndk\". Once finished you can then continue on to start using GameMaker: Studio.
GameMaker:Studio Basic Setup
Once you have correctly installed the Android tools and are ready to proceed, you must then install GameMaker: Studio and ensure that the web server is set up correctly to "talk" to your Android test devices:
- Launch GameMaker: Studio
- If you are a first-time user, then you will need to link your YoYo Account and licence GameMaker: Studio (see here), otherwise you will need to open a project and go to Help > Update Licence. Either way you will need to restart GameMaker: Studio for your new target module to be available.
- Create a new Project
- Select File > Preferences > Web Server
- Web Server Port: This is set to 51268 to 51280 by default. There is no need to change this unless these ports are already in use.
- IP Allowed List: Enter your local IP address range in the format xxx.xxx.xxx.0/24 as seen in this example: 192.168.1.0/24
If you are not sure of your local IP address, you can find it easily by following the instructions found here.
We recommend a direct USB connection from your PC to your phone/tablet, but please note that if you are using wifi to talk to your device, the device should be on the same wifi network as your PC, although you can also configure the Android Debug Bridge (ADB) to connect to a specific IP by setting the Android preferences (see below for more details).
Device Setup For Android
It is essential that the Android device (or devices) you are using with GameMaker: Studio are configured to work properly with the software. Below are the steps to follow to ensure that there are no problems.
Enable USB Debugging
- On your Android device, browse to Settings>Applications>Development and enable USB Debugging. Later versions of Android have this option hidden away, so please check this article to find out how to enable it for your device: http://developer.android.com/tools/device.html
Connecting Your Device
- Connect your Android device to your PC via the data cable (USB)
- The device drivers should be installed automatically at this stage (if they aren't already), but if they are not, then please refer to your device manufacturer's support information to locate and install the correct ADB drivers. It is very important you get ADB drivers, not the standard consumer ones.
- Now test your phone driver to confirm if it's correct. This can be done in a couple of ways:
- If you have already set up a PATH variable to point to ADB directly (see here), then simply Windows Key and R to open a new Run window and type "cmd" (no quotes) and hit enter, then type "adb devices"
- Go to your Android install folder and then the "platform-tools" folder inside it (e.g. C:\android-sdk\platform-tools) and then hold down the shift key and then right-click in some empty space and choose "Open a command window here". In the new command window, type "adb devices" (without the quotes).
Preparing GameMaker: Studio
There is one more very important step to be taken before you can start to create games for Android with GameMaker: Studio, and that is to set up the preferences, which can be found in File>Preferences>Android. Before continuing please make sure your Android device is connected and that you have followed the steps outlined in Device Setup For Android (above).
The first thing to do is go to the SDK Tab and ensure that all your SDK settings are correct and that GameMaker: Studio can access the required SDK files.
You need to make sure that the first three fields contain the correct paths to your SDK, NDK and JDK install locations, and then you should click the "Check Android SDK" and "Check Android NDK" buttons to make sure that all is working correctly. The other options here are for more advanced situations, so we won't be covering them here (check the manual for more details), but it should be noted that you can set a fixed IP address for ADB to connect to from this panel, which is useful for those devices that can't connect via USB like the Amazon Fire Stick.
Once that's all checked it's time to move on and create a Keystore file:
The thing we are going to do here is to Create the Private KeyStore from the Keystore Tab. The KeyStore is a file that will be used to "sign" all your Android apps so please fill in all the details correctly and then back this file up!
- Name - this is the filename of the KeyStore (note : Not your name or the company name!)
- Password - your security password for the KeyStore file which must be at least six characters long.
- Alias - this is the name of the "user" for this keystore and can differ from the Name field above.
- Password - the same password as written in the Password field two above. This is a long-time Android SDK bug.
The right-hand side is optional and has no relation inside GameMaker: Studio, but we'd recommend you fill them in anyway.
- Common Name - this would normally be your name
- Organisational Unit - the department within the company that you are in
- Organisation - the name of your company
- Location - the name of the town or city where you are based
- Country - the two letter code for the country where you are based
Note that all names must have only letters, numbers and spaces but no special characters.
Once this information is filled in and you are happy with it, press the button marked "Generate" for GameMaker: Studio to create the necessary KeyStore file. This may take a moment, but once it is finished you will see that the section marked Private KeyStore File will have been updated to reflect the new name that you have given it. Once this is done it normally will not need to be changed again.
Again, please back up your keystore file somewhere safe and make sure to remember your details - we recommend taking a screenshot with the passwords showing and then back this file up along with your keystore. You can find the generated keystore at the path you have in the top field of this preferences form.
If you lose your keystore or forget the alias/password details you will not be able to perform updates on Google Play or Amazon Fire apps that have already been published!
Running A Game From GM:Studio On Your Android Device
Once you have set up both GameMaker: Studio and your Android device, it's very simple to get your games up and running. The first thing you must do is in GameMaker: Studio go to the target drop-down dialogue in the main window and select "Android" or "Android YYC" (or Amazon Fire, if you are developing for that platform).
Now, the next step depends on whether you have your device connected via data cable or via WiFi. Below are the steps to follow in either case :
Run On A Connected Device
- Make sure your device is connected to your pc through its USB data cable and that you have followed the device setup advice.
- Click the Green play button at the top of the main GameMaker: Studio window to compile your game
- As soon the compiling is complete, your game should appear on the device as designed.
Run On A WiFi Device
Before you can use the WiFi setup, you need to make sure that the device to be tested has the YoYo Games runner installed. This can only be achieved through a data cable connection. This means that you must follow the connected device steps at least once before WiFi connections will work, as this is currently the easiest way to install the runner on the device (you can use Dropbox folders and double-click the runner .pkg on your phone, etc.).
Once the runner is installed on your phone, follow the steps below :
- Make sure that you have correctly configured GameMaker: Studio (see GameMaker: Studio Basic Setup for more details)
- Click the Green play button at the top of the main GameMaker: Studio window to compile your game
- When compiled, tap the YoYo Games Runner on the device and you will get the "connecting" window. Your game will now run as normal, unless this is the first time you are running the WiFi mode, in which case you should also follow the next steps too.
- When the YoYo Games Runner starts up there is button marked Settings. Tap that button to open a new screen with two further options.
- You should set the GM:Studio IP Address to the one that your computer is currently using. If your network supports name resolution you can use the PC's name and avoid issues with the IP changing later.
- You should set the GM:Studio Port Number to match the one that you setup in GamneMaker: Studio Basic Setup (51268 by default)
The game should now connect and run automatically every time that you press the green "play" button on GameMaker: Studio.