How it works
Simply make a request to
https://increment.build/
followed by an identifier of
your choice. It will return 1
and increment that number
every subsequent request.
❯ curl
https://increment.build/my-awesome-app
1
❯ curl
https://increment.build/my-awesome-app
2
❯ curl
https://increment.build/my-awesome-app
3
Switch to a different identifier to get a new counter starting from 0.
❯ curl
https://increment.build/my-awesome-app
4
❯ curl
https://increment.build/my-fancy-app
1
Save the result into an environment variable and use it to build your
product.
❯ export BUILD
= $(curl https://increment.build/my-fancy-app)
❯ echo $BUILD
2
Why do I need this?
-
If you give every build that you make it's own build number, you can
easily figure out which build caused trouble if problems arise.
-
Automatically incrementing the build number requires you to first
figure out what is the highest build number out there, which might
not be trivial.
-
As an iOS or Android developer, you are required to increase the
build number for each binary that you upload. If you forget it, the
binary will be rejected and you will have to compile and upload
again.
-
You want to use continuous integration and don't want to commit
version code increases.
Pricing
$0/month forever!
This service is brought to you for free by
Jonny Burger. As a return, let me
advertise two things really quick! 😊
-
Check out my app
AnySticker,
which allows you to create and publish WhatsApp and Instagram
stickers for your brand!
-
Hire me and and a team of experts to build your MVP in 100 days: We
are Axelra.
FAQ
-
How do I increment the build number of an Xcode project?
Move into the folder where your Info.plist is and execute this
command:
❯
/usr/libexec/PlistBuddy -c
"Set :CFBundleVersion
$(curl
https://increment.build/my-awesome-app)"
Info.plist
-
How do I increment the version code of an Android
project?
In your build.gradle
, make the versionCode variable:
versionCode project.hasProperty('versionCode') ?
project.property('versionCode') as int : 1
then pass the version code like this:
❯ ./gradlew assembleRelease
-PversionCode=$(curl https://increment.build/my-awesome-app)
-
How do I increment the version codes of an Expo project?
This will increment both iOS build number and Android version code
based on separate counters!
❯ node -e
"a=require('./app.json');a.expo.ios.buildNumber=String($(curl
https://increment.build/my-app-ios));a.expo.android.versionCode=$(curl
https://increment.build/my-app-android);require('fs').writeFileSync('app.json',
JSON.stringify(a, null, 2))"
-
How do I increment the build number using Fastlane?
For iOS projects:
increment_build_number(
xcodeproj: './ios/MyAwesomeApp.xcodeproj',
build_number: sh('curl -s https://increment.build/my-awesome-app-ios')
)
For Android projects:
gradle(task: 'assemble', build_type: 'Release', properties: {
versionCode: sh('curl -s https://increment.build/my-awesome-app-android')
})
-
My current build number is already at 2498. How can I make
increment.build start from this number?
There is another endpoint for this. Simply append
/set/{your_number}
and your counter will jump to this
number.
❯ curl https://increment.build/my-awesome-app/set/2498
-
How can I get the current build number without incrementing
it?
You can simply append /get
to get the current build
number without incrementing it. Useful for building counters!
❯ curl https://increment.build/my-awesome-app/get
-
My cURL also prints the progress, not just the build
number!
Try to add the -s flag to prevent progress being printed:
❯ curl -s
https://increment.build/
-
There is no authentication! How do I prevent others from
incrementing my build number?
Just use an identifier that is really hard to guess! What about
increment.build/e447dacc-8323-4e29-aeeb-4bbbbf9b2628? No one will come up with that.
-
I incremented by accident. Can I go back?
You cannot decrease the counter. I recommend that you just don't
care - skipping build numbers is not the end of the world. If you
really want to go back, just use a new identifier.
-
I don't trust you, you will one day serve me malicious code
instead of build numbers!
Good for you, the saying is that trust is good, control is better.
You can add a check that the response that you get from
increment.build is purely numeric.
export BUILD = $(curl https://increment.build/my-awesome-app)
re='^[0-9]+$'
if ! [[ $BUILD =~ $re ]] ; then
echo "error: Not a number" >&2; exit 1
fi
-
I don't want to rely on a third-party service for this!
No problem, this is an open source project and you can host it
yourself. Check out the
GitHub repo
here.
©
Jonny Burger. Yes I live in the future 😎🤖
Website
Twitter