# OnPostprocessBuild build project path does not exist

I am trying to copy some files into the build directory after completing a build, but the path provided as an argument to OnPostProcessBuild does not exist.

[PostProcessBuildAttribute(1)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject)
{
if (target.ToString() == "iOS")
{
Debug.Log("Build Finished for target : " + target.ToString());
Debug.Log("Build Finished at Path : " + pathToBuildProject);
Debug.Log("File pick location : " + objectiveCCodeFilePath);

//Pasted in the xcode exported build
xCodeBuildPath = pathToBuildProject + "/Classes";
Debug.Log("File paste location : " + xCodeBuildPath);
Debug.Log("System.IO.File.Exists(objectiveCCodeFilePath) : " + System.IO.File.Exists(objectiveCCodeFilePath));
Debug.Log("Build path without classes : " + System.IO.File.Exists(pathToBuildProject));//return false
Debug.Log("Build path with classes : " + System.IO.File.Exists(xCodeBuildPath));//return false, but the same path is opening in explorer
//MonoBehaviour.Invoke("CopyFile",2);
//StartCoroutine

}

}


This is showing false. What I am doing wrong?

 Debug.Log("Build path without classes : " + System.IO.File.Exists(pathToBuildProject));//return false
Debug.Log("Build path with classes : " + System.IO.File.Exists(xCodeBuildPath));//return false,


but the same path is opening in explorer

• Have you tried printing the contents of pathToBuildProject and comparing that string to the folder structure you observe in your file explorer? How do the two compare? Sep 8 at 11:19
• Sorry, but how can I do this? The folder structure creates after the build. Sep 8 at 12:08
• I think the evern is running a bit earlier then creating the build folder. I tried to used Invoke and coroutine but they are not usable without monobehaviour. Sep 8 at 12:12
• Step 1: add code to print the path to the debug console, as shown in the documentation. Step 2: build the game and write down what gets printed to the console. Step 3: now that the build has been run, look at the folder it created in your file explorer. Sep 8 at 12:12
• yeah it is exactly the same and opening the file! Sep 8 at 12:20