美文网首页
2.tools-plistBuddy

2.tools-plistBuddy

作者: 嘛尼嘛哄 | 来源:发表于2017-09-23 09:06 被阅读0次

    2.tools-PlistBuddy

    the plist buddy is convince for us operator the plist file in Xcode, we can use the plist buddy command set/add/delete the plist key-value, and wrapper it in the build phases shell scripts

    description:

    /usr/libexec/PlistBuddy --help

    Set :CFBundleIdentifier com.apple.plistbuddy

    //Sets the CFBundleIdentifier property to com.apple.plistbuddy

    Add :CFBundleGetInfoString string "App version 1.0.1"

    //Adds the CFBundleGetInfoString property to the plist

    Add :CFBundleDocumentTypes: dict

    //Adds a new item of type dict to the CFBundleDocumentTypes array

    Add :CFBundleDocumentTypes:0 dict

    //Adds the new item to the beginning of the array

    Delete :CFBundleDocumentTypes:0 dict

    //Deletes the FIRST item in the array

    Delete :CFBundleDocumentTypes

    Deletes the ENTIRE CFBundleDocumentTypes array

    # Disable File Sharing for app store builds

    if [ "$BuildCondition" = "APP_STORE" ]

    then

    /usr/libexec/PlistBuddy -c "Set :UIFileSharingEnabled false" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"

    echo "Disabled file sharing (UIFileSharingEnabled) in ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"

    else

    /usr/libexec/PlistBuddy -c "Set :UIFileSharingEnabled true" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"

    echo "Enabled file sharing (UIFileSharingEnabled) in ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"

    fi

    相关文章

      网友评论

          本文标题:2.tools-plistBuddy

          本文链接:https://www.haomeiwen.com/subject/ataqextx.html