Search Unity

macOS Xcode project - Project takes the name of its folder

Discussion in 'macOS' started by erlemaitre, Jan 30, 2021.

  1. erlemaitre

    erlemaitre

    Joined:
    Oct 30, 2018
    Posts:
    24
    When creating a macOS game with Xcode project generation, the .xcodeproj created has the same name as the folder I selected as destination for my project.
    That causes an issue when getting the path of the project using
    string projectPath = PBXProject.GetPBXProjectPath(report.summary.outputPath);

    For now, my only solution is to manually replace the name of the project inside the path, like so:
    projectPath = projectPath.Replace("Unity-iPhone","<NAME_OF_DEST_FOLDER>");
    But this solution is more of a quick fix... Does the fact that the generated project has the name of the folder where it’s put is expected (instead of always been named "Unity-iPhone" for iOS)? And is there a way to automatically get the destination folder to automate the replacement inside the project path?