.plist files are used by iOS applications to keep configuration properties. These files support arrays as configurations. In deployment process of Azure DevOps pipelines you may want to update these plist files to have values relevant to the target deployment environments. Let’s see usage of plistbuddy utility to update array items in plist files as the plutil (http://scriptingosx.com/2016/11/editing-property-lists/) is unable to apply the changes.
The plutil can insert arrays as described here http://scriptingosx.com/2016/11/editing-property-lists/ . However, it is failing in replacing values in arrays in .plist files.
For example assume the below .plist file array element.
While trying to update arrays with plutil it always crashes with array out of bound errors.
Info.plist: Could not modify plist, error: Failed to insert value [ "msal701274c3-f6c1-4e9f-a2f0-3d30e709ab5a"] at key path CFBundleURLTypes.0.CFBundleURLSchemes with error -[__NSCFConstantString characterAtIndex:]: Range or index out of bounds
However, we can use plistbuddy commands as shown below to update such array items without any problems in Azure Pipelines.
/usr/libexec/PlistBuddy -c "Set :CFBundleURLTypes:0:CFBundleURLSchemes:0 $(authmsal)" $(ipaExtractPath)/Payload/$(iOSApp)/Info.plist
Saturday, 14 December 2019
Replacing iOS .plist Array Properties in Azure Release Pipelines
Labels:
Azure,
Build,
deployment,
DevOps,
ios,
plist,
plistbuddy,
plutil
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Setting up an Azure File Share capacity alert is useful to know when you reach at least 80% of allocated quota for the file share . This w...
-
Dynamic block allows to create nested multi level block structures in terraform code. Conditional usage of such blocks are really useful in...
-
We have discueed, that we have to use an environment variable to handle input parameter default values, if we are using trigger for workflo...
-
Sometimes you may need to edit files especially the web.config or appsettings.json files after deploying your application to Azure App Servi...
-
Pull Request are the controlled way to bring in the changes to your stable branches in your Azure Git repos, or for that matter all Git prov...
No comments:
Post a Comment