plist_surgeon plugin

The all-in-one tool to edit iOS configuration files from one plugin.

fastlane Plugin Badge

Getting Started

This project is a fastlane plugin. To get started with fastlane-plugin-plist_surgeon, add it to your project by running:

fastlane add_plugin plist_surgeon

About plist_surgeon

Edit .plist, .entitlements or .xcprivacy files for any reason as part of your pipeline.

Actions

plist_surgeon

Edit a .plist file.

plist_surgeon(
  path: "./Info.plist",
  key: "CFBundleShortVersionString",
  value: "1.2.3"
)
Parameter Description Required Default
path The path to the plist file Yes
key The key to update (supports dot notation for nested keys) Yes
value The value to set Yes

entitlements_surgeon

Edit an .entitlements file.

entitlements_surgeon(
  path: "./App.entitlements",
  key: "aps-environment",
  value: "production"
)
Parameter Description Required Default
path The path to the entitlements file Yes
key The key to update (supports dot notation for nested keys) Yes
value The value to set Yes

privacy_surgeon

Edit an .xcprivacy file.

privacy_surgeon(
  path: "./PrivacyInfo.xcprivacy",
  key: "NSPrivacyTracking",
  value: false
)
Parameter Description Required Default
path The path to the xcprivacy file Yes
key The key to update (supports dot notation for nested keys) Yes
value The value to set Yes

Complex Values

You can set complex values (Arrays or Hashes) by passing a JSON string. This is especially useful when running from the command line.

fastlane run plist_surgeon \
  path:"Info.plist" \
  key:"CFBundleIcons" \
  value:'{"CFBundlePrimaryIcon":{"CFBundleIconFiles":["AppIcon"]}}'

Run tests for this plugin

To run both the tests, and code style validation, run

rake

To automatically fix many of the styling issues, use

rubocop -a

Issues and Feedback

For any other issues and feedback about this plugin, please submit it to this repository.

Troubleshooting

If you have trouble using plugins, check out the Plugins Troubleshooting guide.

Using fastlane Plugins

For more information about how the fastlane plugin system works, check out the Plugins documentation.

About fastlane

fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.