Created
October 12, 2025 17:05
-
-
Save gingerbeardman/d8247a409cc17e66b9724e6166916438 to your computer and use it in GitHub Desktop.
This script extracts an app from an Xcode .xcarchive, alerts the user, kills any running versions, moves it to /Applications, re-signs it with the specified Developer ID, and then launches the newly signed app.
This file contains hidden or 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
| FILE=`basename "$@" .xcarchive` | |
| PARENT=`dirname "$@"` | |
| ditto "$@"/Products/Applications/ $PARENT/. | |
| printf "\a" | |
| # List all .app directories in $PARENT | |
| for app_path in "$PARENT"/*.app; do | |
| # Extract the app name (basename without .app extension) | |
| app_name=$(basename "$app_path" .app) | |
| pkill -f $app_name | |
| # Remove the app from /Applications | |
| rm -rf "/Applications/$app_name.app" | |
| mv "$PARENT/$app_name.app" "/Applications/" | |
| # Code signing the application | |
| codesign --deep --force --verify --verbose --sign "Developer ID Application: Your Name (A1B234CD56)" "/Applications/$app_name.app" | |
| # Open the app | |
| open "/Applications/$app_name.app" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment