Topics

#230: More Fun with fastlane Actions 🤖🎉

Topics

It's another fastlane Friday! In Bite #140 we began looking at fastlane's actions.

We learned how to add actions to our Fastfile and how they can help truly unlock the full power of fastlane. Today we'll check out a few more actions and look at why we might want to use them. Let's get started!

First up is clear_derived_data. This action does what it says on the tin. (We learned about the DerivedData directory and why clearing it can workaround issues in Xcode in Bite #208). Super handy!

Next, it's ensure_xcode_version. This is great when working on a team, (or for our own sanity) to make sure everyone is on the same, known version of Xcode. We can use it like this:

ensure_xcode_version(version: "7.2")

One action that can be quite versatile is update_info_plist. We can specify a .plist path, (perhaps our app's "main" Info.plist), and modify just about anything inside, here's an example for changing the name depending on how we're deploying:

update_info_plist(
  plist_path: "path/to/Info.plist",
  display_name: "Spaceships-Beta"
)

Finally, let's look at prompt. This action lets us collect data from the user, and use it within our lanes.

Let's try using it to allow us to enter a changelog each time we upload a build to TestFlight with Pilot:

changelog = prompt(
  text: "Changelog: ",
  multi_line_end_keyword: "END"
)

pilot(changelog: changelog)