Skip to content

Instantly share code, notes, and snippets.

@luke161
Created November 7, 2017 15:38
Show Gist options
  • Save luke161/2f841f3b746b045718985ab8b2d15534 to your computer and use it in GitHub Desktop.
Save luke161/2f841f3b746b045718985ab8b2d15534 to your computer and use it in GitHub Desktop.
Unity editor extension to increment iOS build number after each build.
using UnityEditor;
using UnityEditor.Callbacks;
public class AutoIncrementBuildNumber
{
[PostProcessBuild]
public static void OnBuildComplete(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget==BuildTarget.iOS) {
PlayerSettings.iOS.buildNumber = (int.Parse (PlayerSettings.iOS.buildNumber) + 1).ToString();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment