Skip to content

Instantly share code, notes, and snippets.

@jinthagerman
Created February 18, 2016 03:39
Show Gist options
  • Save jinthagerman/ba92904a189014b82947 to your computer and use it in GitHub Desktop.
Save jinthagerman/ba92904a189014b82947 to your computer and use it in GitHub Desktop.
Allow arbitrary loads for debug builds temporarily
#!/bin/sh
INFO_PLIST="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}"
PLISTBUDDY="/usr/libexec/PlistBuddy"
if [ "${CONFIGURATION}" == "Debug" ]; then
$PLISTBUDDY -c "Add :NSAppTransportSecurity dict" "${INFO_PLIST}" || true
$PLISTBUDDY -c "Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool true" "${INFO_PLIST}" || true
$PLISTBUDDY -c "Set :NSAppTransportSecurity:NSAllowsArbitraryLoads true" "${INFO_PLIST}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment