Skip to content

Commit

Permalink
scripts: add resign script
Browse files Browse the repository at this point in the history
  • Loading branch information
osy authored and osy committed Feb 19, 2020
1 parent 7bc4fdd commit 4c98c83
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions scripts/resign.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

if [ $# -ne 4 ]; then
echo "usage: $0 UTM.xcarchive PROFILE_NAME TEAM_ID outputPath"
exit 1
fi

INPUT=$1
PROFILE_NAME=$2
TEAM_ID=$3
OUTPUT=$4
OPTIONS="/tmp/options.plist"

cat >"$OPTIONS" <<EOL
<?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>compileBitcode</key>
<false/>
<key>method</key>
<string>development</string>
<key>provisioningProfiles</key>
<dict>
<key>com.osy86.UTM</key>
<string>${PROFILE_NAME}</string>
</dict>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>${TEAM_ID}</string>
<key>thinning</key>
<string>&lt;none&gt;</string>
</dict>
</plist>
EOL

xcodebuild -exportArchive -exportOptionsPlist "$OPTIONS" -archivePath "$INPUT" -exportPath "$OUTPUT"
rm "$OPTIONS"

0 comments on commit 4c98c83

Please sign in to comment.