Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have used this glist its awesome and works as expected. <a href="https://gist.github.com/sekati/3172554" rel="noreferrer">https://gist.github.com/sekati/3172554</a> (all credit goes to original author)</p> <p>Sctipts that I modified over the time.</p> <p><a href="https://gist.github.com/alokc83/5220205" rel="noreferrer">xcode-versionString-generator.sh</a>,</p> <p><a href="https://gist.github.com/alokc83/5207294" rel="noreferrer">xcode-build-number-generator.sh</a></p> <p>As these gist are helping dev community. I thought to made github project out of it. So lets develop it good. Here is the github project: <a href="https://github.com/alokc83/Xcode-build-and-version-generator" rel="noreferrer">https://github.com/alokc83/Xcode-build-and-version-generator</a></p> <p><strong>I have updated the code for both script little bit of enhancement. instead of using below grab the latest from github</strong></p> <p>For Version :</p> <pre><code># xcode-version-bump.sh # @desc Auto-increment the version number (only) when a project is archived for export. # @usage # 1. Select: your Target in Xcode # 2. Select: Build Phases Tab # 3. Select: Add Build Phase -&gt; Add Run Script # 4. Paste code below in to new "Run Script" section # 5. Check the checkbox "Run script only when installing" # 6. Drag the "Run Script" below "Link Binaries With Libraries" # 7. Insure your starting version number is in SemVer format (e.g. 1.0.0) # This splits a two-decimal version string, such as "0.45.123", allowing us to increment the third position. VERSIONNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") NEWSUBVERSION=`echo $VERSIONNUM | awk -F "." '{print $3}'` NEWSUBVERSION=$(($NEWSUBVERSION + 1)) NEWVERSIONSTRING=`echo $VERSIONNUM | awk -F "." '{print $1 "." $2 ".'$NEWSUBVERSION'" }'` /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $NEWVERSIONSTRING" "${PROJECT_DIR}/${INFOPLIST_FILE}" </code></pre> <p>For build:</p> <pre><code># xcode-build-bump.sh # @desc Auto-increment the build number every time the project is run. # @usage # 1. Select: your Target in Xcode # 2. Select: Build Phases Tab # 3. Select: Add Build Phase -&gt; Add Run Script # 4. Paste code below in to new "Run Script" section # 5. Drag the "Run Script" below "Link Binaries With Libraries" # 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") buildNumber=$(($buildNumber + 1)) /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload