private static void RunOptool(string optoolPath, string opToolCmd)
        {
#if UDL_DEBUG
            Debug.Log("UDL: optool | " + optoolPath + "  " + opToolCmd);
#endif

            ShellHelper.ShellRequest req = ShellHelper.ProcessFileCommand(optoolPath, opToolCmd);
            req.OnLog += delegate(int arg1, string arg2) { Debug.Log(arg2); };

            req.OnDone += delegate()
            {
                Debug.Log("Successfully injected framework on Build");
                _injectionComplete = true;
                BuildProcessor.TriggerOnPostBuildProcessCompleted();
            };

            req.OnError += delegate() { Debug.Log("Error injecting framework on Build"); };
        }
        //private bool IsXcodeBuild(string path)
        //{
        //    return path.EndsWith(".xcodeproj");
        //}
        public void PostBuildProcess(AppLinkingConfiguration configuration, string pathToBuiltProject)
        {
            BuildProcessor.FireCompletionEventAfterCall = false;
            IsXcodeBuild = CheckIfIsXcodeBuild(pathToBuiltProject);
#if UDL_DEBUG
            Debug.Log("UDL: path is " + pathToBuiltProject + " OS " + SystemInfo.operatingSystem + " Is Mac " + IsBuiltOnMac() + " IsXcodeBuild: " + IsXcodeBuild);
#endif


            //
            //  Unity sometimes doesn't include the .app in the pathToBuiltProject
            //
            if (Directory.Exists(pathToBuiltProject) == false)
            {
                pathToBuiltProject += ".app";
            }


            AddDeepLinks(configuration, pathToBuiltProject);

            if (IsXcodeBuild)
            {
                ExtractFrameworkAndAddItToXcode(pathToBuiltProject);
            }

            else
            {
                CopyUniversalDeepLinkFramework(pathToBuiltProject);

                if (IsBuiltOnMac())
                {
                    InjectFrameworkInGameApp(pathToBuiltProject);
                }
                else
                {
                    AddScriptsToIncludeFramework(pathToBuiltProject);
                    BuildProcessor.TriggerOnPostBuildProcessCompleted();
                }
            }
        }
        private void ExtractFrameworkAndAddItToXcode(string pathToBuiltProject)
        {
            //
            //  Extracts framework
            //
            const string frameworksDir = "Frameworks";
            //const string frameworksDir = "Plugins";
            var pathToExport2 = Path.Combine((GetMacOsProjectPath(pathToBuiltProject)), "Plugins");
            var pathToExport  = Directory.GetParent(GetMacOsProjectPath(pathToBuiltProject)).FullName;
            var pathToLib     = Path.Combine(Application.dataPath, EditorHelpers.PluginPath + "/libs/Standalone/UniversalDeepLink.framework.zip");


            ShellHelper.ShellRequest unzip = ShellHelper.ProcessFileCommand("unzip", string.Format("-o \"{0}\" -d \"{1}\"", pathToLib, pathToExport));
            //
            //  Remove this and remove the Copy file options from the pbxx
            //
            ShellHelper.ShellRequest _ = ShellHelper.ProcessFileCommand("unzip", string.Format("-o \"{0}\" -d \"{1}\"", pathToLib, pathToExport2));

            unzip.OnDone += () =>
            {
                string     projectPath = PBXProject.GetPBXProjectPath(_macOsXcodeProj);
                PBXProject project     = new PBXProject();
                project.ReadFromString(File.ReadAllText(projectPath));

                //
                //  Adds framework to pbx
                //
                var frameworkInProject = Path.Combine(Application.productName, frameworksDir);
                frameworkInProject = Path.Combine(frameworkInProject, FrameworkName);
                var prodGuid = project.TargetGuidByName(Application.productName);

                var myFramework = project.AddFile(FrameworkName, frameworkInProject, PBXSourceTree.Source);
                project.AddFileToBuild(prodGuid, myFramework);
                PBXProjectExtensions.AddFileToEmbedLibraries(project, prodGuid, myFramework);

                File.WriteAllText(projectPath, project.WriteToString());
                BuildProcessor.TriggerOnPostBuildProcessCompleted();
            };
        }