TIL: How to integrate fastlane
I am often asked by various members of my team — the non-technical ones, if I can upload a build of the latest version of the app to TestFlight. Sure, it’s not that difficult, but it upsets my dev flow. You know, that zen state of slaying code as you listen to ambient music pulsing through your earbuds.
At the beginning of the day, I would have called myself a Level 4 coder, which equates to: I am now at the point where if I see a problem, I assume that someone else has solved it.
As such, I stumbled upon fastlane, which is a tool that can automate any step of the submission process of your mobile app, from taking screenshots to deploying it publicly.
Integrating 3rd party tools should make life easier, but it often is intimidating and clunky to set them up. Today I decided that the error messages would not get the best of me.
A few challenges to set up fastlane included:
- figuring out that when I was prompted for the App Identifier, this is synonymous with the
PRODUCT_BUNDLE_IDENTIFIERin my project’s Build Settings. xcode-selectpath was set to:/Library/Developer/CommandLineTools(discovered byxcode-select -p, which was not correct).- I needed to change this by switching the path of :
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
I had never worked with a Gemfile before within the context of an iOS application.
Like a Podfile, a Gemfile executes a number of dependencies that your project uses. Gems are built on Ruby, whereas Pods are built with Objective-C or Swift. Like a Podfile.lock and Gemfile.lock records the exact versions that were installed. This way, when the same library/project is loaded on another machine (say by another developer on your team), running bundle install will look at the Gemfile.lock and install the exact same versions, rather than using the Gemfile which installs the most recent versions of a dependency.
Then there was the slack integration, so that if an upload to TestFlight happens, a message is sent to a slack team. I generated a webhook for our Slack team, which is configured here: yourslackteamname.slack.com/apps/A0F7XDUAZ-incoming-webhooks
It felt like a struggle every step of the way - not that any one step was extremely challenging. Yet as someone integrating a third-party tool for the first time, no step is intuitive nor trivial. Thanks to Rabbi Google, I can say… our project is now integrated with fastlane!
Now, at the end of the day, I would call myself a Level 5 coder, which means that I am now at the point where if I see a problem, I assume that someone else has solved it and I can apply their solution to my situation.
#huzzah
