88
Fastlane - Automation & Continuous Delivery for iOS Apps Sarath C, Architect, Experion Technologies

Fastlane - Automation and Continuous Delivery for iOS Apps

Embed Size (px)

Citation preview

Page 1: Fastlane - Automation and Continuous Delivery for iOS Apps

Fastlane - Automation & Continuous Delivery for

iOS AppsSarath C,

Architect, Experion Technologies

Page 2: Fastlane - Automation and Continuous Delivery for iOS Apps

@saratArchitect, Experion Technologies

Page 3: Fastlane - Automation and Continuous Delivery for iOS Apps

State of iOS Development at Experion Technologies

Page 4: Fastlane - Automation and Continuous Delivery for iOS Apps

• We use Swift for all new projects

• We have delivered about 15 iOS projects developed using Swift in past 2 years

• All our developers are trained to work with Swift

• We still use Objective-C — mostly for legacy code base

• Modern tools and workflows to deliver projects

Page 5: Fastlane - Automation and Continuous Delivery for iOS Apps

tools & workflows

Page 6: Fastlane - Automation and Continuous Delivery for iOS Apps

the best tools are…

Page 7: Fastlane - Automation and Continuous Delivery for iOS Apps

something that works well for your team

Page 8: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 9: Fastlane - Automation and Continuous Delivery for iOS Apps

what’s fastlane?

Page 10: Fastlane - Automation and Continuous Delivery for iOS Apps

fastlane lets you define and run your deployment pipelines for different environments

Page 11: Fastlane - Automation and Continuous Delivery for iOS Apps

It helps you unify your app’s release process and automate the whole process

Page 12: Fastlane - Automation and Continuous Delivery for iOS Apps

fastlane connects all fastlane tools and third party tools, like CocoaPods

Page 13: Fastlane - Automation and Continuous Delivery for iOS Apps

lanes

Page 14: Fastlane - Automation and Continuous Delivery for iOS Apps

lanes are typically deployment pipelines

and the recipe is yours

Page 15: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 16: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 17: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 18: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 19: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 20: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 21: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 22: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 23: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 24: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 25: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 26: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 27: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 28: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 29: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 30: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 31: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 32: Fastlane - Automation and Continuous Delivery for iOS Apps

tools

Page 33: Fastlane - Automation and Continuous Delivery for iOS Apps

upload screenshots, metadata and your app to the App Store using a

single command.

Page 34: Fastlane - Automation and Continuous Delivery for iOS Apps

automate taking localized screenshots of your iOS app on

every device

Page 35: Fastlane - Automation and Continuous Delivery for iOS Apps

quickly put your screenshots into the right device frames

Page 36: Fastlane - Automation and Continuous Delivery for iOS Apps

automatically generate and renew your push notification profiles

Page 37: Fastlane - Automation and Continuous Delivery for iOS Apps

because you would rather spend your time building stuff than

fighting provisioning

Page 38: Fastlane - Automation and Continuous Delivery for iOS Apps

create new iOS apps on iTunes Connect and Developer Portal using

the command line

Page 39: Fastlane - Automation and Continuous Delivery for iOS Apps

automatically create and maintain iOS code signing certificates

Page 40: Fastlane - Automation and Continuous Delivery for iOS Apps

the easiest way to run tests of your iOS and Mac app

Page 41: Fastlane - Automation and Continuous Delivery for iOS Apps

building your iOS app has never been easier

Page 42: Fastlane - Automation and Continuous Delivery for iOS Apps

easily sync your certificates and profiles across your team using

Git

Page 43: Fastlane - Automation and Continuous Delivery for iOS Apps

the best way to manage your TestFlight testers and builds from

your terminal

Page 44: Fastlane - Automation and Continuous Delivery for iOS Apps

instantly create a simple signup page for TestFlight beta testers

Page 45: Fastlane - Automation and Continuous Delivery for iOS Apps

a Ruby library to access the Apple Developer Center and iTunes

Connect

Page 46: Fastlane - Automation and Continuous Delivery for iOS Apps

demo

Page 47: Fastlane - Automation and Continuous Delivery for iOS Apps

build. test. screenshots. sign. deliver

Page 48: Fastlane - Automation and Continuous Delivery for iOS Apps

gem install fastlane

Page 49: Fastlane - Automation and Continuous Delivery for iOS Apps

fastlane init

Page 50: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 51: Fastlane - Automation and Continuous Delivery for iOS Apps

👈

Page 52: Fastlane - Automation and Continuous Delivery for iOS Apps

👈

Page 53: Fastlane - Automation and Continuous Delivery for iOS Apps

how authentication works?

Page 54: Fastlane - Automation and Continuous Delivery for iOS Apps

snapshot init

Page 55: Fastlane - Automation and Continuous Delivery for iOS Apps

👈

Page 56: Fastlane - Automation and Continuous Delivery for iOS Apps

👈

Page 57: Fastlane - Automation and Continuous Delivery for iOS Apps

👈

Page 58: Fastlane - Automation and Continuous Delivery for iOS Apps

👈

Page 59: Fastlane - Automation and Continuous Delivery for iOS Apps

match

Page 60: Fastlane - Automation and Continuous Delivery for iOS Apps

$ match appstore

Page 61: Fastlane - Automation and Continuous Delivery for iOS Apps

$ match development

Page 62: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 63: Fastlane - Automation and Continuous Delivery for iOS Apps

HockeyApp

Page 64: Fastlane - Automation and Continuous Delivery for iOS Apps

desc "Deploy a new version to Hockey App" lane :hockey do match(type: "development") gym(scheme: "fastlane-demo") # Build your app - more options available hockey( api_token: API_TOKEN public_identifier: APP_ID, notes: "Changelog", notify: '0', notes:git_branch + ' (Uploaded via fastlane).' ) end

👈

👈👈

Page 65: Fastlane - Automation and Continuous Delivery for iOS Apps

running…

Page 66: Fastlane - Automation and Continuous Delivery for iOS Apps

stats

Page 67: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 68: Fastlane - Automation and Continuous Delivery for iOS Apps

TestFlight

Page 69: Fastlane - Automation and Continuous Delivery for iOS Apps

lane :appstore do increment_build_number cocoapods scan snapshot sigh deliver sh "./customScript.sh"

slack end

Page 70: Fastlane - Automation and Continuous Delivery for iOS Apps

tips

Page 71: Fastlane - Automation and Continuous Delivery for iOS Apps

ruby --versionruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

Page 72: Fastlane - Automation and Continuous Delivery for iOS Apps

$ xcode-select --install $ brew install rbenv $ rbenv install -l $ rbenv install 2.2.5 $ rbenv install 2.3.1 $ rbenv global 2.3.1

Page 73: Fastlane - Automation and Continuous Delivery for iOS Apps

$ vim ~/.zshrc

RBENV_VERSION="system" export PATH="~/.rbenv/shims:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/sbin:~/.rvm/bin" eval "$(rbenv init -)"

Page 74: Fastlane - Automation and Continuous Delivery for iOS Apps

.gitignoremake sure you don’t include fastlane

generated files in your repo

Page 75: Fastlane - Automation and Continuous Delivery for iOS Apps

gitignore.iopro tip: use it in commandline

Page 76: Fastlane - Automation and Continuous Delivery for iOS Apps

frameityou need to download the templates from apple’s website. tool will point you to right place for the first time setup.

Page 77: Fastlane - Automation and Continuous Delivery for iOS Apps
Page 78: Fastlane - Automation and Continuous Delivery for iOS Apps

app iconsYour app icons needs to be configured

properly to upload to App Store. use utilities like makeappicon.com to

generate required images size.

Page 79: Fastlane - Automation and Continuous Delivery for iOS Apps

CI Environment Variables

It’s not a good idea to embed the secret keys and files within the code/repo.

Use environment variables, settings and integration features of CI Server to secure

your data

Page 80: Fastlane - Automation and Continuous Delivery for iOS Apps

use private reposthere are several bots pulling out keys and

content from the public github repo. don’t put your projects at risk.

🔐

Page 81: Fastlane - Automation and Continuous Delivery for iOS Apps

auto build number increment

to automate the build number increment, you have to set the version in the project’s

build settings

https://developer.apple.com/library/ios/qa/qa1827/_index.html

Page 82: Fastlane - Automation and Continuous Delivery for iOS Apps

TestFlight Build# + 1

increment_build_number({ build_number: latest_testflight_build_number + 1 })

Page 83: Fastlane - Automation and Continuous Delivery for iOS Apps

change log from commits

# Collects commits since your last tag and returns a concatenation of their subjects and bodies

changelog_from_git_commits

Page 84: Fastlane - Automation and Continuous Delivery for iOS Apps

ActionsThis is an ultimate guide to bring best out of your fastlane pipeline. This guide contains documentation on fastlane actions to extend fastlane tools.

github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md

Page 85: Fastlane - Automation and Continuous Delivery for iOS Apps

match

A handy utility to securely share your certificates and provision files across the systems. Quite useful when you work with CI servers and multiple machines

Page 86: Fastlane - Automation and Continuous Delivery for iOS Apps

where to go from here?

Page 87: Fastlane - Automation and Continuous Delivery for iOS Apps

• fastlane.tools/ • github.com/fastlane/fastlane • github.com/fastlane/examples • github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md

what’s next?

Page 88: Fastlane - Automation and Continuous Delivery for iOS Apps

👍