automated building in unity to all desktop platforms

The first time I've written a somewhat nice header.

The first time I’ve written a somewhat nice header.

I finally cleaned up one of my personal scripts, and I think it’s ready for public usage. It’s the handiest script I’ve ever made, to be honest.

This script does two things:

1) It will build your last opened Unity project to Windows, Mac, and Linux.

2) It will neatly zip up each build.

Yes, it’s pretty simple, but very useful. Unfortunately this script is Mac-only for now. Perhaps in the near future I will write a batch file for Windows. You could also do it yourself and share it to me! I’m sure many people would love it.

Dropbox Link.

More instructions:

If you’re unsure how to use this, you must make sure of a few things. You must have Unity installed. You must be on a Mac.

Instructions.

  1. Open your project in Unity.
  2. Close Unity.
  3. Download the script file.
  4. Make sure the script file is named “UnityBuildAll.sh
  5. Since downloading a script doesn’t make it executable, you can do one of two things. You can make it executable, or just run it with the shell command. We will do the latter. See Additional Notes below if you want to make it executable.
  6. Open Terminal. (/Applications/Utilities/Terminal)
  7. Navigate to the folder where you downloaded the script file. You can do “cd ~/Downloads” to go to your Downloads folder.
  8. Then, run this command (the $ sign you do not type.)

$ sh UnityBuildAll.sh app_name target_folder readme_file

Replace “app_name” with your game’s name.

target_folder and readme_file are optional arguments.

Replace “target_folder” with where you want the builds to go. By default, they will go to ~/UnityBuilds/appname/ (That’s in your user folder.)

Replace “readme_file” with any readme file you want to include in the zip.

9. Wait until you see the command prompt again, and then you’re done!

Additional notes:

If you want to keep using the script file easily, I recommend “installing” it.

  1. Go to the directory the script file is in using the Terminal. (If it’s in your downloads folder, do “cd ~/Downloads
  2. Make the script file executable by running:

$ chmod +x UnityBuildAll.sh

3. Rename the script to not have .sh at the end.

$ mv UnityBuildAll.sh UnityBuildAll

4. Copy the script to your bin folder (essentially where Terminal programs are stored.) You will need admin rights.

$ sudo cp UnityBuildAll /usr/bin/UnityBuildAll

And that’s about it! Now, you can just run this script wherever you want. That means, to build your game, all you have to do is close Unity, open the Terminal, and run, for example:

$ UnityBuildAll Zarvot ~/ZarvotBuilds

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s