![](/style/images/good.png)
![](/style/images/bad.png)
Automated Bundle Version
source link: https://soffes.blog/automated-bundle-version
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Automated Bundle Version — Hi, I’m Sam
Automated Bundle Version — Hi, I’m Sam
Hi, I’m Sam
This is my blog. I also have a website thing.
Automated Bundle Version
Posted on December 7, 2015
Lately I've been using a script to set my apps’ bundle version.
Add a new Run Script build phase. Change the shell to:
/usr/bin/env ruby
Put the following in the source area (right under the shell field):
git = `sh /etc/profile; which git`.chomp app_build = `#{git} rev-list HEAD --count`.chomp.to_i `/usr/libexec/PlistBuddy -c "Set :CFBundleVersion #{app_build}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"` puts "Updated #{ENV['TARGET_BUILD_DIR']}/#{ENV['INFOPLIST_PATH']}"
This will automatically set your CFBundleVersion
to the number of commits in your current branch. TestFlight requires a different bundle version for each build so this automates away having to remember to mess with that.
Enjoy.
Update 2020-04-01: If you are using the new Xcode Build System, you need to add $(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)
as an one of the "Input Files" for this to work.
What Color Is It
Posted on July 10, 2015
One of my coworkers shared What Colour Is It in our design Slack channel the other day. It works by taking the current time as 6 digits and making that a hex color. For example, in the header it's #172952
. That's 5:29pm and 52 seconds. Kinda neat. I thought it was super cool so I decided to make it a screensaver.
You can download the screensaver here.
It's less than 100 lines of code. Give it a look if you're interested. I'm particularly fond of the font. I'm using new Swift 2 runtime checking:
© 2006-2022 Sam Soffes
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK