.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
-
Dynamic block allows to create nested multi level block structures in terraform code. Conditional usage of such blocks are really useful in...
-
In Azure DevOps YAML pipelines there are several functions available for you to use. replace is such a useful function, which you can use t...
-
We have discueed, that we have to use an environment variable to handle input parameter default values, if we are using trigger for workflo...
-
Adding Azure Container Registry (ACR) service connection to Azure DevOps is really simple as described in " Create Service Connection ...
-
Some times a silly mistake can waste lot of time of a developer. The exception “System.IO.IOException: The response ended prematurely.” whil...
No comments:
Post a Comment