Did you know that you can automate your Unity software builds on Bitrise, with our integration that is tailor-made for Apple Vision Pro spatial computers, AR/VR, and mobile gaming?
Background on Unity Software
What exactly is Unity software?
The leading global game industry software Unity plays an important part in a booming global games market. More games are made with Unity than with any other game technology. More players play games made with Unity, and more developers rely on their tools and services to drive their business... Global gamers downloaded Unity-made games to nearly 2 billion unique mobile devices, in Q1 2016 alone. 34% of the top 1000 free mobile games are made with Unity. Unity customers include Coca-Cola, Disney, Electronic Arts, LEGO, Microsoft, NASA... From large and small studios to independent professionals, more and more developers are moving to Unity. Source
How to add your Unity software project to Bitrise?
Unity software is not supported 1-on-1 on Bitrise, but there is a way to setup your projects and then to test, build and release your games as fast as any other apps of a different project type. As this is a cross-platform project, in the end you'll get an IPA and an APK too, hooray! It is really easy to release them, innit? Let us give you a hand to get there. 🖐
When you set up your project, don't use the scanner but choose the other/custom option...
...and choose a iOS stack.
Download and install
This is a script that downloads the Unity software version you choose, so you can choose whichever matches your project. Install the editor and then you'll need its Android and iOS platforms too.
Let’s see an example: if you want to use the software version Unity2021.3.12f1, you need to look up the package hash at https://unity.com/releases/editor/archive. Look for the download link under the installer:
Example on how to install the editor and the two platform support packages (Android & iOS):
If you would like to use the Rosetta supported unity MacEditorInstaller for compatibility with slower performance, use this command to install it:
After installation you will find the Unity software in the following location:
For running Unity software we need Cacerts.pem to be placed at the right location. Unity software will generate this file for us, so let's run it for the first time.
You'll need to have a valid license key to build Unity software projects on Bitrise. Sadly, only paid plans are working through the command line - and therefore in Bitrise.
Running the Personal (free) version needs activation through the UI and using your personal serial number.
To activate your license key use the following code, which will activate the license and link the VM with your account:
Building your project
Now let's jump to a more interesting part, building your app!
By inserting this script to your workflow you can start building your Unity software apps on Bitrise. In the end it will generate an APK for your Android app and an IPA for your iOS app.
You'll need this for Android:
... and this for iOS:
An Xcode project will be generated, and that will have to be built in the usual way to obtain the IPA.
We've already connected your license with the actual virtual machine, but we have to make sure it's deactivated at the end, so you will be able to re-use it. If you fail to deactivate the license you can still contact the Unity software helpdesk and get it sorted out, but it is way simpler to do it here 😊
To make sure it's deactivated add the following script step to your workflow:
Set the step to Run even if previous Step failed otherwise you risk that it won't get deactivated if your build fails!
This is what a finished build looks like on Bitrise. Pretty cool, eh?
As you can see there is an iOS.ipa and an Android.apk generated in one build! Next time you'll use this, it'll be as quick as all your other apps! :)
Do you have any more questions? Join our expanding community focused on developing with Unity software (on Slack and Discuss) to request features, troubleshoot issues or get inspired. Plus, feel free to reach out to our expert support team if you're stuck.
Happy building 🚀