Are you planning to create a Unity game for mobile devices? Wondering how you can export your game and build it as an app on Android? Look no further — here’s a step-by-step guide to exporting your game onto your Android device, updated for 2023.
If you’re looking for a way to test your game as you’re making it, check out Unity Remote — it’s an Android app that mirrors Unity Editor’s Game screen when you are in Play Mode. Once you’ve installed it, we have a guide covering how to get Unity Remote working on your devices.
- APK files are Android installers
- Installing Android Build Support
- Setting the Build Platform
- Building the APK file
- Conclusion
1. APK files are Android installers
To install your game as an Android app, you need to export it as an APK file, upload it onto your Android device and run the file.
Fun fact: APK files are actually just ZIP files named with an .apk
extension instead of the traditional .zip
. You can change the extension of an APK to .zip
and open it like you would open a ZIP file, but you can’t do much with the files inside.
Article continues after the advertisement:
2. Installing Android Build Support
For Unity to be able to export your game as an APK, you need to install the Android Build Support module on the Unity Editor that you are using to build your project.
a. Is Android Build Support installed?
To check if you already have Android Build Support installed, head to the Installs tab on Unity Hub, and check if your installed Editor(s) have Android listed under them. Those that do have Android Build Support installed.
b. How to install Android Build Support
If the editor version that you are using doesn’t have Android Build Support, you’re going to have to install it by clicking on the dropdown at the top-right corner of the editor version and selecting the Add Modules option.
If the Add Modules option is missing, that means your Unity version was not installed using Unity Hub. You will have to uninstall that version manually and reinstall it.
This will bring you to a screen with a list of modules available for that version of the Unity Editor. Select all of the modules under the Android Build Support dropdown, then click on the Next button to install them.
When it’s done, Android Build Support will be active on that version of the Unity Editor.
3. Setting the Build Platform
With Android Build Support installed, you will be able to switch the build platform of your project to Android. To do so, go to File > Build Settings and select the Android platform. Then, click on the Switch Platform button.
4. Building the APK file
Once your platform is switched over to Android, the Switch Platform button should be replaced with a Build button. Click on the Build button, and Unity should prompt you for a location to save your APK file.
Save your APK file and upload it onto your phone. Then, open it on your phone to install it as an app!
Before you build your APK file, you may want to click on the Player Settings button at the bottom-left of the Build Settings window. In here, there is a setting that allows you to control which device orientation your game can be played on.
If you don’t know what orientations you want to use, we recommend checking the Landscape Right and Landscape Left options, since most Unity projects are built on Desktops and Laptops, and they have landscape screen ratios.
5. Conclusion
If you run into a problem while exporting your APK, feel free to drop a comment describing your problems below. We do respond to comments on this blog, and we will reply to your comment with a list of possible solution(s). If your comment highlights a common issue that is relevant to this post, we will also update the post to mention the problem(s) you encountered, plus the suggested fixes.
Article continues after the advertisement:
Thank you for providing this informative guide on exporting a Unity project as an APK for Android in 2023. It’s a valuable resource for game developers looking to bring their creations to Android devices. The step-by-step instructions, along with screenshots, make the process clear and accessible. Kudos!
Pas de boutons Construire mais Exporter à la place sur la dernière version de Unity et ça ne construit pas un fichier APK mais un dossier avec pleins de sous-dossiers
I have had an issue with building an apk, which isn’t necessarily related to this tutorial. But hope someone have some kind of expertise.
The problem :Login Authentication UI works perfectly on Unity Editor, but doesn’t work on an android device.
So I have implemented all of the features that are displayed on the Sign In screen. Logging in with PLAYFAB credentials, Signing Up, Google authentication and Facebook authentication and Guest Login using the device id. Apple authentication is yet to be executed.
However on my android device, only the google authentication button works i.e the google icon. When It’s clicked it logs into my google play games id and Sign up i.e creating a new account.
THE PROBLEM (persists only on an android device):
None of my other buttons work (Log in, Play as a guest, Facebook), well they don’t even interact like buttons anymore. Atleast if they were clickable/ interactable, I would have thought it’s happening because of the code or cross checked my functions.
So this is where it’s more weird. I get different outcomes on different devices…
UPDATE: On one device both Google and Facebook icons are interactable and google successfully authenticates, but on another device even though google is interactable, it’s not able to authenticate, while facebook isn’t interactable at all. However login and play as guest are consistently not interactable. While on the third device google is interactable and authenticates while facbook isn’t interactable.
Where should I be looking to fix this? What possibly is going wrong here ?
Hope I get some kind of response. Been stuck at it for days.
Thanks for your time.
Hey Anudeep, is it possible that in your Canvas, your buttons are being blocked by another element? If you have a transparent Image element (for e.g. a black fader), it will block clicks even though it is see-through.
It may be working on certain devices and not others because different screen resolutions change the positioning of your UI elements, and may cause different objects to be blocked.