Skip to content

Instantly share code, notes, and snippets.

@JonathanPorta
Last active August 29, 2015 14:19
Show Gist options
  • Save JonathanPorta/0747cb7e34fb857fb724 to your computer and use it in GitHub Desktop.
Save JonathanPorta/0747cb7e34fb857fb724 to your computer and use it in GitHub Desktop.
Unity3D Build Script
#! /bin/sh
# Example build script for Unity3D project. See the entire example: https://github.com/JonathanPorta/ci-build
# Change this the name of your project. This will be the name of the final executables as well.
project="ci-build"
echo "Attempting to build $project for Windows"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-batchmode \
-nographics \
-silent-crashes \
-logFile $(pwd)/unity.log \
-projectPath $(pwd) \
-buildWindowsPlayer "$(pwd)/Build/windows/$project.exe" \
-quit
echo "Attempting to build $project for OS X"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-batchmode \
-nographics \
-silent-crashes \
-logFile $(pwd)/unity.log \
-projectPath $(pwd) \
-buildOSXUniversalPlayer "$(pwd)/Build/osx/$project.app" \
-quit
echo "Attempting to build $project for Linux"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-batchmode \
-nographics \
-silent-crashes \
-logFile $(pwd)/unity.log \
-projectPath $(pwd) \
-buildLinuxUniversalPlayer "$(pwd)/Build/linux/$project.exe" \
-quit
echo 'Logs from build'
cat $(pwd)/unity.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment