Last active
June 27, 2017 08:57
-
-
Save rsattar/1c518ada051142359fd0 to your computer and use it in GitHub Desktop.
Set ApplicationGroupContainerIdentifier in Settings.bundle to group.$(CFBundleIdentifier)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the already-processed Info.plist, which has our bundleId, etc. | |
processedInfoPlistFile=$TARGET_BUILD_DIR/$INFOPLIST_PATH | |
# Copy the bundle identifier from our processed Info.plist | |
bundleId=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$processedInfoPlistFile") | |
# Prefix it with "group." to make the application group container id | |
appGroupContainerId=group.$bundleId | |
# Get the already-copied Settings.bundle/Root.plist | |
appPackageFolder=$TARGET_BUILD_DIR/$EXECUTABLE_FOLDER_PATH | |
copiedSettingsBundlePlistFile=$appPackageFolder/Settings.bundle/Root.plist | |
echo "Setting $copiedSettingsBundlePlistFile's ApplicationGroupContainerIdentifier to $appGroupContainerId" | |
# Save the app group container id as the value for Settings.bundle | |
/usr/libexec/PlistBuddy -c "Set :ApplicationGroupContainerIdentifier $appGroupContainerId" "$copiedSettingsBundlePlistFile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment