PRODUCT_NAME_APP in User-Defined Settings not correct

Hello,
When building project to a Xcode project, Unity will generate a user-defined setting named ‘PRODUCT_NAME_APP’ in project.pbxproj file. In the past, it used the last part of my bundle identifier as the value of PRODUCT_NAME_APP. (I am not sure if this is the logic, but the value just equals to the last part of bundle identifier.) But after I upgraded Unity Version from 2020.1.0f1 to 2020.3.1f1, The value always be ‘ProductName’.

But when I use 2020.3.1f1 to create a new project and build it to a xcode project, the value does equals to the last part of bundle identifier. So I don’t know what’s wrong within my old projects. Why cannot it generate the value of PRODUCT_NAME_APP.

7093654--844924--PRODUCT_NAME_APP.JPG

+1 as I see the same. We updated the project from Unity 2019 to 2020.3.12f1 and our ipa file has a different name.

Please let me know if you found a solution for this.

I cannot find any official solution. So, I write a script to replace ‘ProductName’ to what I want.

public class iOSPostProcessBuild
{
    [PostProcessBuildAttribute(0)]
    public static void OnPostprocessBuild(BuildTarget target, string path){
        if(target==BuildTarget.iOS){
            string pbxProjectPath = PBXProject.GetPBXProjectPath(path);
            string pbxProjectContent = File.ReadAllText(pbxProjectPath);
            pbxProjectContent = pbxProjectContent.Replace(
                "PRODUCT_NAME_APP = ProductName;", "PRODUCT_NAME_APP = myappname;");
            File.WriteAllText(pbxProjectPath, pbxProjectContent);
        }
    }
}
1 Like

thank you ! I cannot find any solution too