PremadeMacEntitlements

PremadeMacEntitlements

#Overview

name: PremadeMacEntitlements

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of PremadeMacEntitlements is to specify the file path for the development entitlements used in Mac builds of an Unreal Engine project.

This setting variable is primarily used by the Mac platform-specific modules of Unreal Engine, specifically the MacPlatformEditor and MacTargetPlatform. These modules are responsible for handling Mac-specific project settings and build configurations.

The value of this variable is set through the Unreal Engine Editor’s project settings interface. It is defined as a UPROPERTY in the UXcodeProjectSettings class, which allows it to be edited and saved as part of the project configuration.

PremadeMacEntitlements interacts with other Mac-specific settings, particularly ShippingSpecificMacEntitlements, which specifies the entitlements file for shipping builds. Both are part of the broader Xcode project settings customization system.

Developers must be aware that this variable is only relevant when targeting Mac platforms and is conditionally displayed in the editor based on the bUseModernXcode flag. It’s crucial to ensure that the specified entitlements file exists and contains the appropriate permissions for the application.

Best practices when using this variable include:

  1. Always provide a valid path to an existing entitlements file.
  2. Ensure the entitlements file contains the necessary permissions for your application’s features.
  3. Keep development and shipping entitlements separate to maintain proper security practices.
  4. Be cautious when modifying this value, as it directly affects the application’s capabilities and security settings on macOS.
  5. Use source control for managing changes to the entitlements files to track modifications over time.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3193, section: [/Script/MacTargetPlatform.XcodeProjectSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/Mac/MacPlatformEditor/Private/XcodeProjectSettingsDetailsCustomization.cpp:26

Scope (from outer to inner):

file
function     void FXcodeProjectSettingsDetailsCustomization::CustomizeDetails

Source code excerpt:

    TemplateMacPlist = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UXcodeProjectSettings, TemplateMacPlist));
    TemplateIOSPlist = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UXcodeProjectSettings, TemplateIOSPlist));
    PremadeMacEntitlements = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UXcodeProjectSettings, PremadeMacEntitlements));
    ShippingEntitlements = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UXcodeProjectSettings, ShippingSpecificMacEntitlements));
    
    IDetailCategoryBuilder& PlistCategory = DetailLayout.EditCategory(TEXT("Plist Files"));
    PlistCategory.AddCustomRow(LOCTEXT("InfoPlist", "Info.plist"), false)
    .WholeRowWidget
    [

#Loc: <Workspace>/Engine/Source/Developer/Mac/MacPlatformEditor/Private/XcodeProjectSettingsDetailsCustomization.cpp:143

Scope (from outer to inner):

file
function     FReply FXcodeProjectSettingsDetailsCustomization::OnRestoreEntitlementClicked

Source code excerpt:

    }
    
    PremadeMacEntitlements->SetValueFromFormattedString(TEXT("(FilePath=\"/Game/") + (FString)kDefaultMacResourcesFolder + TEXT("Sandbox.Server.entitlements\")"));
    
    // Copy the default entitlememt from Engine
    if (!SourceControlHelpers::CopyFileUnderSourceControl(FPaths::ProjectDir() + kDefaultMacResourcesFolder + TEXT("Sandbox.NoNet.entitlements"),
                                                          FPaths::EngineDir() + kDefaultMacResourcesFolder + TEXT("Sandbox.NoNet.entitlements"),
                                                          FText::FromString(TEXT("Sandbox.NoNet.entitlements")),
                                                          /*out*/ ErrorMessage))

#Loc: <Workspace>/Engine/Source/Developer/Mac/MacPlatformEditor/Public/XcodeProjectSettingsDetailsCustomization.h:28

Scope (from outer to inner):

file
class        class FXcodeProjectSettingsDetailsCustomization : public IDetailCustomization

Source code excerpt:

    TSharedPtr<IPropertyHandle> TemplateMacPlist;
    TSharedPtr<IPropertyHandle> TemplateIOSPlist;
    TSharedPtr<IPropertyHandle> PremadeMacEntitlements;
    TSharedPtr<IPropertyHandle> ShippingEntitlements;
};

#Loc: <Workspace>/Engine/Source/Developer/Mac/MacTargetPlatform/Classes/XcodeProjectSettings.h:96

Scope (from outer to inner):

file
class        class UXcodeProjectSettings : public UObject

Source code excerpt:

	 */
	UPROPERTY(EditAnywhere, config, Category="Entitlements", meta = (EditCondition="bUseModernXcode", DisplayName = "Mac: Development Entitlements"))
	FFilePath PremadeMacEntitlements;
	
	/**
	 * The premade entitlement file used for shipping Mac builds
	 */
	UPROPERTY(EditAnywhere, config, Category="Entitlements", meta = (EditCondition="bUseModernXcode", DisplayName = "Mac: Shipping Entitlements"))
	FFilePath ShippingSpecificMacEntitlements;