+ All Categories
Home > Software > The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

Date post: 08-Apr-2017
Category:
Upload: redblacktree
View: 105 times
Download: 1 times
Share this document with a friend
15
The Mobile Toolchain with Fastlane
Transcript
Page 1: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

The Mobile Toolchain with Fastlane

Page 2: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

What is Fastlane?

• Automates beta deployments and releases for iOS & Android apps.

• Generates screenshots.

• Takes care of code signing.

• Very simple to use and remember commands.

Page 3: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
Page 4: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

How to install?

1. Make sure that the latest version of Xcode tools is installed:xcode-select --install 2. Use homebrew to install fastlane:brew cask install fastlane 3. In terminal, navigate to your project’s root directory, and run the command:fastlane init

Page 5: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

After you run fastlane init for iOS, your project’s root directory will contain a fastlane folder:

Page 6: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

What are those files in the fastlane folder for?

• Fastfile - contains script for building and uploading beta/release builds, uploading screenshots and metadata.

• Deliverfile - Used when uploading your build / screenshots to iTunesConnect / App Store.

• Appfile - contains app identifier, your Apple ID and Team ID.

Page 7: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

A Typical Fastlane Script

Page 8: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

Lanes are used to tailor your build processes to suit your needs.

Page 9: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

Let’s go step-by-step.

First, the beta lane. This lane executes as follows:

1. increment_build_number : Increments build number by 1. You don’t have to do it manually by opening up Xcode and typing in the new build number.

2. gym : This tool builds your project and produces the .xcarchive folder. The archive will show up in Xcode’s Organizer.

3. testflight : This tool uploads you’re ipa file to Apple’s Testflight.

Page 10: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

Now let’s go through the appstore lane:

1. snapshot : This tool generates screenshots for your app automatically. You have to create a UI Testing target for your app in Xcode and record a UI test. More on this later.

2. gym : Same as before.

3. deliver : This tool uses the Deliverfile to upload screenshots to iTunes Connect.

4. slack : Finally, a message is posted on slack regarding the upload.

Page 11: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

How do I run this script?

In your terminal, just type in:fastlane beta to run the beta lanefastlane appstore to run the appstore lane

Page 12: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

lane :beta do cert( development: true, force: false, username: "Your_Apple_ID", keychain_password: "Your_Keychain_Password" )

gym( scheme: "Your_Scheme_Name", clean: true, codesigning_identity: "Your_Certificate_Name", export_method: "app-store", use_legacy_build_api: true ) testflight( username: "Your_Apple_ID", app_identifier: "Your_App_Bundle_Identifier", skip_submission: true, skip_waiting_for_build_processing: true )end

My Script

Page 13: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

Short Explanation

The script does the following:

1. cert checks if a development certificate is installed locally in the machine. If not, it can create one.

2. gym builds the .ipa file for the app. The codesigning_identity to be used for building is passed. For Testflight/App Store builds, export_method must be app-store. legacy_build_api must be true for SwiftSupport folder to be created.

3. testflight uploads the build to Testflight. username and app_identifier are used to connect to iTunesConnect. skip_submission set to true to only upload the build and not promote to app store. skip_waiting_for_build_processing set to true so that the script exits after submitting build.

Page 14: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

It generally takes 5 - 10 minutes to get the email from Apple regarding the status of your build.

Compare this to uploading builds using Xcode which will take hours of effort to upload a single build. Also, the Fix Issue button is dangerous to use, as it might reset all provisioning profiles.

Fastlane is way cleaner.

Page 15: The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree

Thank You!


Recommended