Xcode - Cannot modify plist using PlistBuddy in script

782 Views Asked by At

I want to set UIFileSharingEnabled key to true using script. Script code:

echo "set file sharing to true"

BASE_PLIST="${SRCROOT}/Customization/Info.plist"
/usr/libexec/PlistBuddy -c "Print :UIFileSharingEnabled" "$BASE_PLIST"
/usr/libexec/PlistBuddy -c "Set :UIFileSharingEnabled bool true" "$BASE_PLIST"
/usr/libexec/PlistBuddy -c "Print :UIFileSharingEnabled" "$BASE_PLIST"

console print:

Please help

1

There are 1 best solutions below

0
phnmnn On

Solution: remove "bool"

/usr/libexec/PlistBuddy -c "Set :UIFileSharingEnabled true" "$BASE_PLIST"