Customizing Your info.plist File

From RAD Studio
Jump to: navigation, search

Go Up to Preparing a macOS Application for Deployment

Go Up to Preparing an iOS Application for Deployment


RAD Studio writes some options of your applications for macOS or iOS to a file, *.info.plist, which is included in your final application package when you deploy your application to macOS or iOS. This file defines things such as the version code or display name of your application, the list of capabilities that your application requires, and so on.

Usually, you do not need to touch this file, and you can let RAD Studio take care of everything for you. However, RAD Studio allows you to customize the content of the *.info.plist file if you need to include custom data in this file that you cannot define visually in your project options.

When you deploy an application to the macOS or iOS target platforms for the first time, RAD Studio adds a file to your project folder: info.plist.TemplateOSX.xml or info.plist.TemplateiOS.xml. Whenever you deploy your application to macOS or iOS, RAD Studio reads the corresponding file, replaces some placeholders in the file with actual values from your project options, and writes the resulting content into an output file: <platform>\<build configuration>\*.info.plist. This output file is the *.info.plist file that is included in the application package that RAD Studio generates when you deploy your application to the macOS or iOS target platforms.

To customize the output *.info.plist file of a single project, edit the content of info.plist.TemplateOSX.xml or info.plist.TemplateiOS.xml in the project folder.

The template files that RAD Studio adds to a project when you deploy that project to the macOS or iOS target platforms for the first time comes from the corresponding file in C:\Users\<username>\AppData\Roaming\Embarcadero\BDS\23.0. If you want your new projects to have a different starting template file, edit this file.

Re-creating the info.plist Template Files

The info.plist template file that RAD Studio generates can change from one version of RAD Studio to another. To deploy a project that was originally deployed with a different version of RAD Studio, be especially careful with the existing info.plist template files from your project folder.

There are two possible scenarios:

  • You want to keep the old info.plist template files because they are customized.
  • You do not need to keep the old info.plist template files.

Keeping the info.plist Template Files

You might want to keep your info.plist template files if you manually did modifications to them. In this case, you need to follow these steps:

  1. Open your project folder.
  2. Be sure to back up your info.plist template files.
  3. Delete the info.plist template files from the project folder.
  4. Open your project with the new version of RAD Studio.
  5. For each affected target platform (macOS 64-bit, macOS ARM 64-bit, and iOS Device 64-bit :
    1. Select the target platform node on the Projects Window.
    2. Deploy your project to the selected target platform.
      Note: Deploying your project creates a new info.plist template file for the selected target platform.
    3. Go to your project folder to check that there is a new info.plist template file.
    4. Manually add your changes to the new info.plist template file.

Creating a New info.plist Template Files

If you did not modify the info.plist template files, follow these steps to let RAD Studio create new files:

  1. Open your project folder.
  2. Delete the info.plist template files, if they exist.
  3. Open your project with the new RAD Studio version.
  4. For each affected target platform (macOS 64-bit, macOS ARM 64-bit, and iOS Device 64-bit):
    1. Select the target platform node on the Projects Window.
    2. Deploy your project to the selected target platform.
      Note: Deploying your project creates a new info.plist template file for the selected target platform.
    3. Go to your project folder to check that there is a new info.plist template file.

Contents of the info.plist Template Files

The info.plist template files contain two placeholders that RAD Studio replaces by key-value pairs during the deploying applications overview. The following value indicates which info.plist keywords replace each placeholder:

Placeholder Replacement Content

<%VersionInfoPListKeys%>

<%ExtraInfoPListKeys%>

  • Keywords about artwork, based on the information on the Application page.
  • For iOS:
    • Keywords about orientation support, based on the information on the Orientation page.
    • Keywords for disabling the APS feature if the "Enable HTTP protocol requests" feature is disabled in the Entitlement List page.
    • CFBundleShortVersionString, based on the value of the corresponding fields in the Version Info page.
    • UIRequiredDeviceCapabilities is "arm64" for iOS Device - 64 bit or "armv7" for other platforms.
    • For iOS device platforms:
      • CFBundleSupportedPlatforms is "iPhoneOS".
      • CFBundleResourceSpecification is "ResourceRules.plist" (RAD Studio generates this file).
      • MinimumOSVersion is the value configured for the "Minimum iOS version supported" option in the following options page:
        • Delphi: Project > Options > Delphi Compiler > Linking
        • C++: Project > Options > C++ Linker
      • For the Application Store platform configuration:
        • DTPlatformName is "iphoneos".
        • The values for DTPlatformBuild and DTXcodeBuild depend on the SDK that you use to build your application.

See Also