Book Image

Continuous Delivery for Mobile with fastlane

By : Doron Katz
Book Image

Continuous Delivery for Mobile with fastlane

By: Doron Katz

Overview of this book

Competitive mobile apps depend strongly on the development team’s ability to deliver successful releases, consistently and often. Although continuous integration took a more mainstream priority among the development industry, companies are starting to realize the importance of continuity beyond integration and testing. This book starts off with a brief introduction to fastlane—a robust command-line tool that enables iOS and Android developers to automate their releasing workflow. The book then explores and guides you through all of its features and utilities; it provides the reader a comprehensive understanding of the tool and how to implement them. Themes include setting up and managing your certificates and provisioning and push notification profiles; automating the creation of apps and managing the app metadata on iTunes Connect and the Apple Developer Portal; and building, distributing and publishing your apps to the App Store. You will also learn how to automate the generation of localized screenshots and mesh your continuous delivery workflow into a continuous integration workflow for a more robust setup. By the end of the book, you will gain substantial knowledge on delivering bug free, developer-independent, and stable application release cycle.
Table of Contents (27 chapters)
Title Page
Dedication
www.PacktPub.com
Foreword
Contributors
Preface
Index

Preface

While working for a start-up in San Francisco, as an iOS developer, I've had the arduous recurring task of having to gather all the coding contributions from my fellow colleagues, run some tests, and package the project for the stakeholders and beta testers to test, find bugs, patch, and re-distribute. 

Finally, when we get to the green-light stage, we package the application once again for publication to the App Store, update the metadata, update or add new screenshots, and so forth. Of course, with start-ups growing as rapidly as they do, so do the size of their development teams, which leaves you having to spend time on-boarding the new team members and setting up their environments with provisioning profiles and certificates. 

Having your attention and focus diverted from your primary goal of feature development bug fixing in order to deal with  repetitious application-delivery tasks is certainly frustrating, which is what inspired me to investigate ways to automate this process. 

We already implement regression testing in an automated manner, through continuous integration, so there should be a way of being able to automate the process of packaging our apps, pushing them to TestFlight or the App Store, and dealing with provisioning our apps. Introducing fastlane...

Who this book is for

fastlane is a powerful Ruby-powered toolchain that empowers iOS (and Android) developers to automate the process of delivery through what is called continuous delivery. If your passion is for developing workflows that automate the process of building and packaging your apps for distribution, without having to deal with provisioning and other code-signing processes, this book is for you.

This book is primarily targeted at mobile developers (iOS primarily), although we will be touching on some tools that Android developers can take advantage of. This isn't a Swift or Objective-C book, and you will certainly be able to follow with just some basic mobile development skills, although we will be working a lot in the command line as well as Apple's Developer portal and iTunes Connect. Some knowledge of how apps are built, provisioned, signed, and distributed will be helpful, but we will also be introducing a lot of the basic concepts in each of the chapters. 

What this book covers

Chapter 1, Introduction to fastlane and Continuous Delivery, is an introduction to the fastlane toolchain, and why you should adopt continuous delivery as part of your workflow. 

Chapter 2, Setting Up fastlane and Our Sample Project, sets you up for the rest of the chapters by guiding you through setting up and installing fastlane and the sample project. 

Chapter 3, Manage Provisioning Profiles with sigh, covers how to manage provisioning profiles manually via Xcode and how to leverage fastlane to automate the process of provisioning your apps using sigh. 

Chapter 4, Manage Code Signing Certificates with cert, explains how to work with developer and production certificates using Xcode, and how to leverage fastlane to automate the process of certifying your apps using cert. 

Chapter 5, Sync Profiles and Certificates with match, covers how to improve your certificate and provisioning workflows leveraging match, making it easier for you to on-board new developers and share the right code-signing credentials to get that developer started right away.

Chapter 6, Manage Push Notification Profiles with pem, discusses how to manage push notification profiles manually, and automate your workflow using fastlane and pem. 

Chapter 7, Creating Our iOS and Android Apps with produce and supply, goes through how to easily create your app on iTunes Connect and the Developer portal via terminal and produce, by using fastlane, or by creating an Android app on the Google Play Store using Supply. 

Chapter 8, Build and Package Apps for the App Store with gym, explains how to build and package your apps the traditional way using Xcode, and how to leverage gym as part of your fastlane continuous delivery workflow to automate building and packaging your apps.

Chapter 9, Distribute to Testers with TestFlight and Crashlytics, covers how to add continuous delivery distribution to your testers using TestFlight and Crashlytics within fastlane. 

Chapter 10, Review Your App Metadata with precheck, explains how to automate the process of reviewing your app for red flags using precheck prior to uploading your app to the App Store for review. 

Chapter 11, Taking Localized Screenshots with snapshot, tells you how to automatically generate screenshots of your apps for iTunes Connect using snapshot. 

Chapter 12, Put Our Screenshots inside Frames with frameit, discusses how to prettify your screenshots by putting them inside frames using fastlane's frameit action.

Chapter 13, Upload Screenshots and Metadata with deliver, explains how to deliver your generated and prettified screenshots automatically to iTunes Connect, as part of your fastlane workflow, using deliver. 

Chapter 14, Automate Unit Tests with Scan, covers how to include automated testing as part of your fastlane workflow and continuous delivery goals using scan. 

Chapter 15, Integrating Git into the fastlane Workflow, discusses how to leverage the industry-leading Jenkins CI within your fastlane workflow in order to integrate continuous delivery with continuous integration for a completely robust, agile, end-to-end system workflow. 

Chapter 16, Creating and Using fastlane Action Plugins, explains how to make use of some powerful Git commands within fastlane in order to build an intimate relationship between your code repository and your continuous delivery workflow. 

Chapter 17, Integrating Slack into the fastlane Workflow, covers how to enrich and empower your fastlane continuous delivery workflow by leveraging system and third-party action plugins. 

Chapter 18, Continuous Delivery Best Practices, explains how to leverage the popular communications platform Slack to inform your development team as part of your continuous delivery workflow. 

Appendix, Configurations, Tools, and Resources, contains tips on how to make the most of fastlane through best practices and anti-patterns. 

To get the most out of this book

You are encouraged to follow the examples sequentially, from Chapter 1Introduction to fastlane and Continuous Delivery,  to the final chapter, using the sample project and code.

The Chapter 2, Setting Up fastlane and Our Sample Project, covers setting up your environment, installing fastlane, and any other prerequisite tools.

You will also need to have an active Apple Developer account, which you can get from developer.apple.com.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Continuous-Delivery-for-Mobile-with-fastlane/tree/master. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Open Client.xcodeproj in Xcode, then switch to the Fennec scheme."

A block of code is set as follows:

export_options(
  method: "ad-hoc",
        provisioningProfiles: { 
    "com.doronkatz.firefox": "Provisioning Profile Name"
  },
  manifest: {
    appURL: "https://yourapp.com/yourapp.ipa",
  },
  thinning: "<thin-for-all-variants>"
)

Any command-line input or output is written as follows:

fastlane init

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "You are also able to create new signing identities from this dialog screen by selecting the Create button."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email [email protected] and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.