When making a custom System Settings panel, I want the project to automatically move the prefpane file to /Library/PreferencePanes/. With Run Script, the build fails because of denial to perform the operation. Sudo doesn't help, too.
PREFPANE_SRC="${BUILT_PRODUCTS_DIR}/App.prefPane"
PREFPANE_DST="$HOME/Library/PreferencePanes/"
echo "PrefPane source path: $PREFPANE_SRC"
echo "PrefPane destination path: $PREFPANE_DST"
if [ -d "$PREFPANE_SRC" ]; then
echo "Installing preference pane to ${PREFPANE_DST}"
cp -R "${PREFPANE_SRC}" "${PREFPANE_DST}"
else
echo "Preference pane not found: ${PREFPANE_SRC}"
exit 1
fi
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags:
Xcode
macOS
Scripting
App Sandbox