Last active
November 22, 2023 17:06
-
-
Save malash/57759401fd6fd853b9c0fe55f80f29fc to your computer and use it in GitHub Desktop.
Drag `.app` to this sheel to fix run issue for macOS
This file contains 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
#!/bin/bash | |
echo "Drag \`.app\` to this shell or press enter to quit:" | |
echo -n "> " | |
read line | |
if [ -z $line ]; then | |
exit 0 | |
fi | |
file=`realpath $line` | |
echo "Cleaning xattr..." | |
xattr -d com.apple.quarantine $file >/dev/null 2>&1 | |
xattr -p com.apple.quarantine $file >/dev/null 2>&1 | |
if [ $? == 1 ]; then | |
echo "Success!" | |
else | |
echo "Failed!" | |
fi | |
echo "Run ad hoc signing..." | |
codesign --force --deep -s - $file | |
codesign -v $file | |
if [ $? == 0 ]; then | |
echo "Success!" | |
else | |
echo "Failed!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment