How to increase iOS build number in Appcelerator Titanium

I am building a distribution directly from the titanium studio to upload to iTunes Connect to test Apple Testflight pre-sale testing. My current version of the application is 1.1.1, and the build number is automatically set by the titanium studio to version 1.1.1.

In Xcode, usually the Prerelease build number (CFBundleVersion) is supported by most developers as a whole, which is very convenient to increase by 1 each time before downloading to iTunes. From a titanium studio, this is impossible!

In tiapp.xml I installed this

<ios>
    <plist>
        <dict>
            <key>CFBundleShortVersionString</key>
            <string>1.1.1</string>
            <key>CFBundleVersion</key>
            <string>10</string>
        </dict>
    </plist>
</ios>

After starting from Titanium Studio, the created info.plist file in the build folder will become

<ios>
    <plist>
        <dict>
            <key>CFBundleShortVersionString</key>
            <string>1.1.1</string>
            <key>CFBundleVersion</key>
            <string>1.1.1</string>
        </dict>
    </plist>
</ios>

I know that in the application documentation this has already been mentioned, CFBundleVersionand CFBundleShortVersionStringwill become the same from the tag value <version>in the generated info.plist.

, Apple Testflight Ti - (CFBundleShortVersionString) # , iTunes Connect, . Xcode Build #, Ti xcode - .

, . - / # Titanium Studio ?

.

+4
3

, iTunes/Testflight, 1- 3- (, 1.0.0), 4- , iTunesConnect/testflight (, 1.0.0.1)

1.0.0 itunesconnect 1.0.0.1 tiap.xml

+10
  grunt.registerTask('tiapp', function() {
    var tiapp = require('tiapp.xml').load();
    var version = tiapp.version.split('.');
    tiapp.version = version[0] + '.' + version[1] + '.' + (parseInt(version[2], 10) + 1);
    tiapp.write();
    grunt.log.writeln(require('util').format('Bumped version to: %s', tiapp.version));
  });

. Grunt https://gist.github.com/FokkeZB/4754f93f8b325156c33c

http://tonylukasavage.com/blog/2014/01/23/automating-appcelerator-tasks-with-grunt-titanium-and-grunt-alloy/

+2

Xcode . .

-:

if [ ${CONFIGURATION} == "Debug" ]; then
buildNumber=-1
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
else
buildNumber=$(git rev-list HEAD | wc -l | tr -d ' ')
flag=""
if [ ! ${CONFIGURATION} == "Release" ]; then
flag="b"
fi;
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber$flag" "${PROJECT_DIR}/${INFOPLIST_FILE}"
fi;

reset -1 ( ):

# reset the build number to the default -1 to prevent issues in git 
commits
buildNumber=-1
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"

git ( ), . reset info.plist.

CFBundleShortVersionString , .

+1

All Articles