Automating Unity Builds — Part 3 : Upload to Beta Test Platform

Fadhil Noer Afif
3 min readMay 19, 2020

--

Photo by Hello Lightbulb on Unsplash

This is the third part of a blog series of how we construct our system to automate building Unity projects. You can refer of the overview of this process here.

One of the key elements in the concept of Continuous Integration is how available your application to be tested. As such, it is desirable for our game to be available for testing as frequent as possible. We have managed to handle the “build” step in part 1 and part 2. In this post, we will talk about how to automatically distribute the binary files to a beta testing platform.

Beta Distribution Platform

In our day-to-day building and testing process, we want to make sure that our game is tested extensively before we distribute it to the users. This means that we need our development build to be distributed only for predefined number of tester. This is where Beta Distribution platforms comes in handy. We can upload to their server, select tester groups and deliver the build whenever it’s ready for testing. Some platform also have additional features such as performance measurement, video recordings, etc.

There are a number of services that can be used as Beta testing platform. Our studio uses Microsoft’s Visual Studio App Center (previously known as HockeyApp). You may also use any other services such as Testfairy or Firebase App Distribution.

In this post, we will be focusing on automating distribution to VS App Center. We will be using Fastlane again as the tools to automate the process.

Automating Distribution to VS App Center with Fastlane

App Center is a handy platform for distributing binaries for testing. Using its dashboard, we can upload, assign testers, and distribute it with a few clicks. While this is helpful, we will take the process to the next level by automating all the process using Fastlane.

Natively, Fastlane does not have built-in feature for App Center. Fortunately, Fastlane is an open platform, so it is fully extendable for those who are willing. The team at Microsoft has created a Fastlane plugin for App Center that we can use in a Github repo.

We will start by installing the Fastlane plugin on the machine by runningfastlane add_plugin appcenter.

Then, we will use appcenter_upload command to upload the binary to the platform. The example command for uploading .ipa file looks like :

You can also add additional parameters such as timeout or release_notes to suit your needs.

We will then combine the command with the previous match and gym step used in the previous post. For example :

Finally, we can run the lane by calling fastlane ios build_ipa to automatically handle all the signing, exporting IPA, and beta distribution process.

Summary

By implementing this part, we managed to complete a full cycle for automating the Unity building process via command line.

  1. Exporting Unity to XCode
  2. Generate IPA
  3. Upload to Distribution Platform.

If you feel fancy, you can wrap all the process into a single shell or command file, so that you can run all the process with a single click. Convenient!

This concludes the prerequisite for running a fully automatic building process for Unity projects. In the next post, we will take this to the next level by putting the process into a CI server. This will enable us to harness the power of CI server to make our builds always available whenever changes are pushed to your git repository. Stay tuned!

--

--

Fadhil Noer Afif
Fadhil Noer Afif

Written by Fadhil Noer Afif

Half-nerd, half-geek. Director at Reima Project, a game development studio.

No responses yet