ios - Xcode - 无法在脚本中使用 PlistBuddy 修改 plist

标签 ios xcode plistbuddy

我想使用脚本将 UIFileSharingEnabled 键设置为 true。 脚本代码:

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"

控制台打印:

请帮忙

最佳答案

解决方案:删除“bool”

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

关于ios - Xcode - 无法在脚本中使用 PlistBuddy 修改 plist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56922837/

相关文章:

ios - 在 iOS 中搜索获取应用程序崩溃

c++ - Xcode header 困惑

ios - 在我的 iPhone 文件夹中,如何为我的应用创建文件夹? [iOS 13]

ios - 在 iOS-Charts (Xcode 7.3.1) 中设置 X 轴和 Y 轴时出错

bash - 将 stdin 传递给 plistbuddy

ios - 在应用程序终止和设备重启后,PushKit通知未到达

ios - 如何计算所有类被调用的次数

ios - Interface Builder 文件中的未知类 ViewController

arrays - 使用 plistBuddy 获取值数组

ios - 在构建阶段编辑 app.entitlements 文件