Skip to content

Instantly share code, notes, and snippets.

@Mazyod
Created January 18, 2017 11:36
Show Gist options
  • Save Mazyod/a9d3e41bf22602b9ae2297b73503da10 to your computer and use it in GitHub Desktop.
Save Mazyod/a9d3e41bf22602b9ae2297b73503da10 to your computer and use it in GitHub Desktop.
#!/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