Skip to content

Instantly share code, notes, and snippets.

@kezzico
Created August 15, 2018 19:53
Show Gist options
  • Save kezzico/c8f149c2cae8b64e481f2809f9bade9f to your computer and use it in GitHub Desktop.
Save kezzico/c8f149c2cae8b64e481f2809f9bade9f to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
projectname="<YOUR_PROJECT_NAME>"
projectpath="`pwd`/$projectname.xcodeproj"
workspace="$projectname.xcworkspace"
schemename="$projectname"
provisionprofile="iOS Team Provisioning Profile: 68WTNC8XPF.co.kezzi.$projectname"
plistPath="$projectname/Info.plist"
# /usr/libexec/PlistBuddy
#lastBuildNumber=`PlistBuddy $plistPath -c "Print:CFBundleVersion"`
#buildNumber=`PlistBuddy $plistPath -c "Print:CFBundleVersion"`
#let buildNumber+=1
#PlistBuddy $plistPath -c "Set:CFBundleVersion $buildNumber"
xcodebuild -workspace "$workspace" -scheme "$schemename" -sdk "iphoneos" -configuration "Release" PROVISIONING_PROFILE="$provisionprofile"
#clean
xcodebuild clean -project "$projectpath" -configuration Release -alltargets
#archive
xcodebuild archive -workspace "$workspace" -scheme "$schemename" -archivePath "$projectname.xcarchive"
#ipa
xcodebuild -exportArchive -archivePath "$projectname.xcarchive" -exportPath "./" -exportOptionsPlist export-options.plist
@kezzico
Copy link
Author

kezzico commented Aug 15, 2018

export options plist

<?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>
  <true/>
  <key>manifest</key>
  <dict>
    <key>appURL</key>
    <string>https://</string>
    <key>displayImageURL</key>
    <string>https://</string>
    <key>fullSizeImageURL</key>
    <string>https://</string>
  </dict>
  <key>method</key>
  <string>ad-hoc</string>
  <key>provisioningProfiles</key>
  <dict>
    <key>co.kezzi.$provisioningprofilename</key>
    <string>$provisioningprofilename</string>
  </dict>
  <key>signingCertificate</key>
  <string>iPhone Distribution</string>
  <key>signingStyle</key>
  <string>manual</string>
  <key>stripSwiftSymbols</key>
  <true/>
  <key>teamID</key>
  <string>$teamid</string>
  <key>thinning</key>
  <string>&lt;none&gt;</string>
</dict>
</plist>

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