How to copy folder from Asset to xcode project as folder references?

Hi guys,

I have googling and messeing around for a while and here is a code I end up with

    [PostProcessBuild]
    public static void MyPostProcess(BuildTarget buildTarget, string pathToBuiltProject) {
        if (buildTarget == BuildTarget.iOS) {
      
            string projPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
            PBXProject proj = new PBXProject();
    
            proj.ReadFromString(File.ReadAllText(projPath));
            string target = proj.TargetGuidByName("Unity-iPhone");

            proj.AddFileToBuild(target,proj.AddFolderReference(Application.dataPath+"/Plugins/test/chocobo.png", "test/chocobo.png"));
            File.WriteAllText(projPath, proj.WriteToString());
        }
    }

What I got after postprocess is this. (Group)

But this is what I expected. (Folder References)

Through the process when draging the folder into the project like this.

Can anyone tell me how to do this? Thanks!

3154066--239823--Screen Shot 2017-07-21 at 22.57.04.png
3154066--239824--Screen Shot 2017-07-21 at 22.56.26.png

1 Like

I would love this explained !

Just include in the Streamingassets folder

True, but then it ends up in /Raw/Data

I’d really rather use the Copy function … to put it in the bundle root.