Skip to content

Instantly share code, notes, and snippets.

@Azuritul
Forked from mxpr/0.1-export-plist.sh
Created September 27, 2016 01:19
Show Gist options
  • Save Azuritul/1609ab30991417477a547bfdc557be91 to your computer and use it in GitHub Desktop.
Save Azuritul/1609ab30991417477a547bfdc557be91 to your computer and use it in GitHub Desktop.
Export Options Plist flag in xcodebuild
# Switch xcrun to leverage Xcode 7
# Note: This won't be needed once Xcode 7 is released
# and becomes the primary Xcode in use.
export DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer/
# Export Archive
xcrun xcodebuild -exportArchive -exportOptionsPlist exportPlist.plist -archivePath /path/to/app.xcarchive -exportPath /path/to/app.ipa
<?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>teamID</key>
<string>MYTEAMID123</string>
<key>method</key>
<string>app-store</string>
<key>uploadSymbols</key>
<true/>
</dict>
</plist>
# Archive
xcodebuild -scheme MyApp -archivePath builds/MyApp.xcarchive archive
# Switch xcrun to leverage Xcode 7
# Note: This won't be needed once Xcode 7 is released and is the
# primary Xcode in use.
export DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer/
# Export Archive
xcrun xcodebuild -exportArchive -exportOptionsPlist exportPlist.plist -archivePath builds/MyApp.xcarchive -exportPath builds/MyApp.ipa
# Unzip the ipa file to verify contents
cd builds
unzip -q MyApp.ipa
ls -al
# We should see the following folders
# - Payload
# - SwiftSupport
# - Symbols
# - WatchKitSupport
cd Payload
#Verify Watch App
xcrun codesign -dv MyApp.app/PlugIns/MyApp\ WatchKit\ Extension.appex/MyApp\ WatchKit\ App.app
#Verify Watch Extension
xcrun codesign -dv MyApp.app/PlugIns/MyApp\ WatchKit\ Extension.appex
#Verify main app
xcrun codesign -dv MyApp.app
#!/bin/sh
# Install Provisioning profiles from the command line
# Credit: http://stackoverflow.com/questions/11128284/provide-xcodebuild-with-mobileprovision-file
#
# Usage:
# ./install_profile.sh /path/to/provisioning_profile
#
die() { echo "$@" 1>&2 ; exit 1; }
if [ ! $# == 1 ]; then
echo "Usage: $0 (/path/to/provisioning_profile)"
exit
fi
provisioning_profile=$1
uuid=$(/usr/libexec/PlistBuddy -c 'Print UUID' /dev/stdin <<< $(security cms -D -i $provisioning_profile)) || die "Could not extract profile from $provisioning_profile"
echo "Found UUID: $uuid"
output=~/Library/MobileDevice/Provisioning\ Profiles/$uuid.mobileprovision
echo "copying to $output.."
cp "${provisioning_profile}" "$output" || die "failed to copy $provisioning_profile to $output"
echo "done"
@AnneTheAgile
Copy link

AnneTheAgile commented Oct 2, 2016

I am trying to get my symbols with Xcode8. Using verify-results.sh's tip to unzip gives me, when I remove the -q for quiet;
$ unzip /Users/MYPATH/build/IPA/Dev-iPhone-Jenkins-14.ipa
Archive: /Users/MYPATH/build/IPA/Dev-iPhone-Jenkins-14.ipa
replace Payload/DevelopIt.app/01 add photo.png? [y]es, [n]o, [A]ll, [N]one, [r]ename:
So I cancelled that. In Xcode GUI. I do have build settings for "DWARF plus DSYM".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment