Skip to content

Instantly share code, notes, and snippets.

@Mazyod

Mazyod/package.sh

Created Jan 18, 2017
Embed
What would you like to do?
#!/bin/sh
set -e
CERT_NAME='3rd Party Mac Developer Application: [YOUR NAME]'
APP_NAME='mygame.app'
ENTITLEMENTS='mygame.entitlements'
# remove existing meta files
find ${APP_NAME} -type f -regex '.*meta' -delete
# copy fixed plist files you have already prepared
# pro tip: change bundle id for unitypurchasing to something cusotm
cp Info.plist ${APP_NAME}/Contents/Info.plist
cp Info-lib1.plist ${APP_NAME}/Contents/Plugins/lib1.bundle/Contents/Info.plist
cp Info-unitypurchasing.plist ${APP_NAME}/Contents/Plugins/unitypurchasing.bundle/Contents/Info.plist
# fix permissions
chmod -R a+xr ${APP_NAME}
codesign -f --verify --verbose --deep \
-s ${CERT_NAME} \
--entitlements ${ENTITLEMENTS} \
${APP_NAME}/Contents/Plugins/lib1.bundle
codesign -f --verify --verbose --deep \
-s ${CERT_NAME} \
--entitlements ${ENTITLEMENTS} \
${APP_NAME}/Contents/Plugins/unitypurchasing.bundle
codesign -f --verify --verbose --deep \
-s ${CERT_NAME} \
--entitlements ${ENTITLEMENTS} \
${APP_NAME}
productbuild --component ${APP_NAME} /Applications --sign ${CERT_NAME} ${APP_NAME}.pkg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment