http://stackoverflow.com/questions/6569120/resigning-an-application-outside-xcode
#!/bin/sh
TEMPDIR=/tmp/$RANDOM-$RANDOM-$RANDOM
RESOURCERULES=/tmp/ResourceRules-$RANDOM$RANDOM.plist
CURRENTDIR=`pwd`
mkdir -p "$TEMPDIR"
cat - > "$RESOURCERULES" <<ResourceRulesPlistDelimiter
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>rules</key>
<dict>
<key>.*</key>
<true/>
<key>Info.plist</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>ResourceRules.plist</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>100</real>
</dict>
</dict>
</dict>
</plist>
ResourceRulesPlistDelimiter
unzip -q "$1" -d "$TEMPDIR" || exit 1
xattr -d -r com.apple.quarantine "$TEMPDIR"
for APPBUNDLE in "`find "$TEMPDIR" -name "*.app"`"; do
codesign --resource-rules="$RESOURCERULES" -f -s "iPhone Developer" "$APPBUNDLE"
codesign -dvvvv -r- "$APPBUNDLE"
done
cd "$TEMPDIR"
zip -qr "$TEMPDIR.zip" "Payload" && cd "$CURRENTDIR" && mv "$1" "$1.bak" && mv "$TEMPDIR.zip" "$1"
cd "$CURRENTDIR"
rm -rf "$TEMPDIR.zip"
rm -rf "$TEMPDIR"
rm -rf "$RESOURCERULES"
usage:Save the script as a text file, go into the terminal, cd into the script‘s directory, chmod +x NameOfFile.sh, and then run ./NameOfScript.sh IPAName.ipa