Deleting .xib from xcode build and remove reference

Hello,

I’m trying to automate the process of deleting the .xib from my xcode build.
To simply delete the file I’m using this on postProcessBuild:

FileUtil.DeleteFileOrDirectory(path+“/LaunchScreen-iPad.xib”);

But xcode still has reference to the file so I have to manually remove it from the project as well in order to run the build. Is there any way to make this work?

The other thing I’m trying to do is remove the Launch Images from Image.xcassets (retina HD 4.7 and retina hd 5.5) in order to run the game in display zoom mode. Any ideas on how to do that?

Thanks!

You need to use Xcode API. Something like FindFileByProjectPath and RemoveFile should do what you want.

Even using RemoveFile Xcode still has the reference =/

Remember to save the xcode project after removing the file.

xcodeProject.RemoveFile(fileGuid);
xcodeProject.WriteToFile(xcodeProjectPath);