#if UNITY_IOS using System.IO; using UnityEditor; using UnityEditor.Callbacks; using UnityEngine; public class CleaningUpPostProcess { [PostProcessBuild] public static void CleaningUp(BuildTarget buildTarget, string pathToBuiltProject) { string library_path = Path.GetDirectoryName(Application.dataPath) + "/Library/"; string[] filenames_list = { "ShaderCache.db", "shadercompiler-UnityShaderCompiler0.log", "shadercompiler-UnityShaderCompiler1.log", "shadercompiler-UnityShaderCompiler2.log", "shadercompiler-UnityShaderCompiler3.log", "shadercompiler-UnityShaderCompiler4.log", "shadercompiler-UnityShaderCompiler5.log", "shadercompiler-UnityShaderCompiler6.log", "shadercompiler-UnityShaderCompiler7.log", "shadercompiler-UnityShaderCompiler8.log", "shadercompiler-UnityShaderCompiler9.log" }; foreach (string filename in filenames_list) { string file_path = library_path + filename; if (File.Exists(file_path)) File.Delete(file_path); } } [MenuItem("Tools/PostProcessBuild/Clean up!")] public static void PostProcessBuildiOS() { CleaningUp(BuildTarget.iOS, Path.GetDirectoryName(Application.dataPath) + "/build_xcode/"); } } #endif