How do I replace a value in an plist array using plutil?

I think PlistBuddy is the recommended tool here:

/usr/libexec/PlistBuddy -c "Set :PARENT:0:KEY_IN_ARRAY valueX" sample.plist 

The command modifies the value of KEY_IN_ARRAY in the first dict of PARENT. The one in the second dict would be changed with:

/usr/libexec/PlistBuddy -c "Set :PARENT:1:KEY_IN_ARRAY valueY" sample.plist 

The -c switch executes the command directly. The file mustn't be a binary plist!


plutil -replace CFBundleDisplayName -string TestFlightX.com Info.plist