How to edit plist after build?

I want to add a post-build script to remove an item from the .plist for the AU builds of my plugin, but I can’t seem to quite grasp the correct form. Here’s what I have (name changed):

plutil -remove “AudioComponents/Item 0/tags/Item 0” “My Plugin.component/Contents/Info.plist”

I suspect I need to specify a path to the final destination of the plugin, but this also has to build using Jenkins on our build machine, so I can’t use my user name in the path. Anyone know the correct way to specify the AU plugin for a post-build script in the .jucer project?

I also need it to only modify the plist file for AU builds, but I see that the post-build scripts gets added to every target, including the Shared Code target. How can I edit the only AU component’s plist file, and either not execute the script for other targets or not fail when attempting to do so for other targets, causing the whole build to fail?

Instead of trying to get JUCE/Xcode to work together, I just do this manually for my local builds, and added a PlistBuddy command to our build machine’s build script to delete the one entry I needed removed. Seemed like the easiest solution.

What does your plist command look like?

I made a .sh script and tried xmlstarlet

xmlstarlet ed -P -S -L -s /plist/dict -t elem -n key -v "com.apple.security.cs.disable-library-validation" myplugin.component/Contents/Info.plist
xmlstarlet ed -P -S -L -s /plist/dict/key[.="com.apple.security.cs.disable-library-validation"] -t elem -n true -v "" myplugin.component/Contents/Info.plist

But this messed up the formatting of my .plist file.

I also tried, and didn’t get working:

plutil -insert com.apple.security.cs.disable-library-validation -bool true myplugin.component/Contents/Info.plist

ok I think I got it

// to insert
/usr/libexec/PlistBuddy -c "Add :com.apple.security.cs.disable-library-validation bool true" mypluginname.plugintype/Contents/Info.plist

//to verify
/usr/libexec/PlistBuddy -c "Print" mypluginname.plugintype/Contents/Info.plist