Skip to content

Instantly share code, notes, and snippets.

@liortal53
Created September 13, 2015 08:48
Show Gist options
  • Save liortal53/2f516b0aa5aae178c2c5 to your computer and use it in GitHub Desktop.
Save liortal53/2f516b0aa5aae178c2c5 to your computer and use it in GitHub Desktop.
Workaround for removing UnityEngine.xml that is included for iOS builds
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
/// <summary>
/// Helper class for removing UnityEngine.xml that is included in iOS builds (bug)
/// </summary>
public static class UnityEngineDocsRemover
{
[PostProcessBuild]
public static void RemoveDocsFromBuild(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget == BuildTarget.iOS)
{
var xmlDocumentationFiles = Directory.GetFiles(pathToBuiltProject, "UnityEngine.xml", SearchOption.AllDirectories);
foreach (var xmlDoc in xmlDocumentationFiles)
{
UnityEngine.Debug.Log("Removing: " + xmlDoc);
File.Delete(xmlDoc);
}
}
}
}
@martinmaxk
Copy link

UnityEditor does not exist after building the game. Test before sharing.

@martinmaxk
Copy link

Oh, sorry I forgot I had to create a folder named "Editor" and put the script there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment