I have a commandline tool written in swift that edits xcode project settings.
I need to be able to delete a 'key' from the .entitlements file.
The specific situation is that I have some projects that do not support associated domains but I need to remove the whole
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:xxx.page.link</string>
</array>
from the file in a gracefull way because leaving just the array empty means the project indicates using associated domains and it does not.
so in short using swift remove a key from a plist.
The simplest solution would be using PlistBuddy.
You'll have to launch a shell command with something like this: https://stackoverflow.com/a/26973384/3393964
The command would be something like:
/usr/libexec/PlistBuddy -c 'Delete :com.apple.developer.associated-domains' Info.plist